Nested Layout Problem - View not appearing
What I have is two buttons at the top (equally filling 50% of the width of the screen) and below I have a ViewFlipper. The flipper is not appearing anymore. :(
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android">
android:id="@+id/linearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FAFAFA"
<LinearLayout
android:id="@+id/linearLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button1" android:text="button 1"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_weight="1"/>
<Button android:id="@+id/button2" android:text="button 2"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_weight="1"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/relativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/linearLayout02">
<ViewFlipper
android:layout_height="wrap_content"
android:l开发者_如何学Cayout_width="wrap_content"
android:id="@+id/viewFlipper01">
<include android:id="@+id/one" layout="@layout/view_one" />
<include android:id="@+id/two" layout="@layout/view_two" />
</ViewFlipper>
</RelativeLayout>
</LinearLayout>
add android:orientation="vertical" to first LinearLayout
try to set the buttons width to fill parent. that's the only thing that comes to my mind when i see your code. having them on fill parent with a same weight will also make them equaly wide.
And also Orientation Vertical
精彩评论