Проблема с вложенным макетом - представление не отображается - PullRequest
0 голосов
/ 15 июня 2011

У меня есть две кнопки вверху (одинаково занимающие 50% ширины экрана), а внизу у меня есть ViewFlipper.Ласты больше не появляются.: (

    <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:layout_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>

Ответы [ 2 ]

2 голосов
/ 15 июня 2011

добавить андроид: Ориентация = "вертикальная" к первой LinearLayout

0 голосов
/ 15 июня 2011

попробуйте установить ширину кнопок для заполнения родительского элемента.это единственное, что приходит мне в голову, когда я вижу твой код.наличие их на родительском заполнителе с таким же весом также сделает их одинаково широкими.

А также вертикальная ориентация

...