fill_parent replace match_parent,try it. targetsdkversion is 3?
在 2011-7-14 下午2:33,"Shri" <[email protected]>写道:
>> I see a red rectangle above a blue rectangle with this layout using
> "layout_below" on the lower blue rectangle.
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:layout_width="match_parent"
> android:layout_height="match_parent" >
> <View android:id="@+id/id_red_view"
> android:layout_width="200dip"
> android:layout_height="100dip"
> android:background="#ffff0000" />
> <View android:id="@+id/id_blue_view"
> android:layout_width="200dip"
> android:layout_height="100dip"
> android:layout_below="@+id/id_red_view"
> android:background="#ff0000ff" />
> </RelativeLayout>
>
> However, with this layout using "layout_above" on the upper red
> rectangle, I see just the blue rectangle. HierarchyViewer shows that
> the red rectangle *is* above the blue rectangle, but its getHeight()
> is 0.
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:layout_width="match_parent"
> android:layout_height="match_parent" >
> <View android:id="@+id/id_red_view"
> android:layout_width="200dip"
> android:layout_height="100dip"
> android:layout_above="@+id/id_blue_view"
> android:background="#ffff0000" />
> <View android:id="@+id/id_blue_view"
> android:layout_width="200dip"
> android:layout_height="100dip"
> android:background="#ff0000ff" />
> </RelativeLayout>
>
> Setting android:minHeight on the red rectangle does not fix the
> problem. I tried swapping the order of the views to avoid a forward
> reference, but that does not help either. Any idea why this is
> happening? Is layout_above just broken?
>
> Thanks,
> Shri
>
> --
> 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

Reply via email to