Also whenever you have problems with the UI not showing correctly,
"hierarchyviewer" is a very valuable tool to look at what is going on in the
view hierarchy.

Problems like these are very unlikely to be related to fragments, but in how
the view hierarchy has been constructed.

2011/4/17 Kostya Vasilyev <kmans...@gmail.com>

> Er, I meant wrong in portrait mode. Where the orientation is "vertical".
> 17.04.2011 12:52 пользователь "Kostya Vasilyev" <kmans...@gmail.com>
> написал:
>
> > Your fragments in landscape mode have wrong width/height. Should be:
> > width=match_parent, height=0, whereas you have them switched.
> > 17.04.2011 12:42 пользователь "Brill Pappin" <bpap...@sixgreen.com>
> написал:
> >> I'm very confused on why my fragments refuse to draw in portrait mode
> and
> >> draw fine in landscape mode.
> >>
> >> I'm build a screen with two fragments. in landscape they are
> side-by-side
> >> and in portrait they are supposed to stack one above the other.
> >> however now matter what I seem to try, the portrait mode refuses to draw
> > the
> >> fragments.
> >>
> >> I can also not use any layout except LinearLayout and even then if I add
> >> the LinearLayout android:orientation="vertical" the fragments refuse to
> >> draw.
> >>
> >> I'd actually prefer to use the RelativeLayout in this case, but i does
> not
> >
> >> display anything at all.
> >> To illustrate what i'm doing:
> >>
> >> This works...
> >>
> >> <?xml version="1.0" encoding="utf-8"?>
> >>
> >> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android
> "
> >>
> >> android:orientation="horizontal" android:layout_width="match_parent"
> >>
> >> android:layout_height="match_parent">
> >>
> >>
> >> <fragment android:name="sixgreen.pots.ReceiptFragment" android:id=
> >> "@+id/saleReceiptFragment"
> >>
> >> android:layout_weight="1" android:layout_width="0dp"
> > android:layout_height=
> >> "match_parent" />
> >>
> >>
> >> <fragment android:name="sixgreen.pots.SaleControlFragment" android:id=
> >> "@+id/saleControlFragment"
> >>
> >> android:layout_weight="1" android:layout_width="0dp"
> > android:layout_height=
> >> "match_parent" />
> >>
> >>
> >> </LinearLayout>
> >>
> >>
> >> ... and this *does not* work...
> >>
> >> <?xml version="1.0" encoding="utf-8"?>
> >>
> >> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android
> "
> >>
> >> android:orientation="vertical" android:layout_width="match_parent"
> >>
> >> android:layout_height="match_parent">
> >>
> >>
> >> <fragment android:name="sixgreen.pots.ReceiptFragment" android:id=
> >> "@+id/saleReceiptFragment"
> >>
> >> android:layout_weight="1" android:layout_width="0dp"
> > android:layout_height=
> >> "match_parent" />
> >>
> >>
> >> <fragment android:name="sixgreen.pots.SaleControlFragment" android:id=
> >> "@+id/saleControlFragment"
> >>
> >> android:layout_weight="1" android:layout_width="0dp"
> > android:layout_height=
> >> "match_parent" />
> >>
> >>
> >> </LinearLayout>
> >>
> >>
> >>
> >> (yes, they are in different resource dirs; layout-land and layout-port
> >> respectively.)
> >>
> >> I've been hacking away at this for a while now, trying all sorts or
> >> permutations and layouts with no luck.
> >>
> >>
> >> Does anyone have any suggestions on what i might try, or even how to
> debug
> >
> >> this, that i may not have tried already?
> >>
> >> At 4:30 am, it's time to give up and get some sleep :)
> >>
> >>
> >> - Brill Pappin
> >>
> >>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> >> Groups "Android Developers" group.
> >> To post to this group, send email to
> android-developers@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> android-developers+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to