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" <[email protected]> написал: > 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 [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

