Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 嵌套布局问题-视图未出现_Android_Xml_Layout_Android Layout - Fatal编程技术网

Android 嵌套布局问题-视图未出现

Android 嵌套布局问题-视图未出现,android,xml,layout,android-layout,Android,Xml,Layout,Android Layout,我在顶部有两个按钮(占屏幕宽度的50%),在下面有一个ViewFlipper。鳍状肢不再出现( android:id=“@+id/linearLayout01” android:layout\u width=“fill\u parent” android:layout\u height=“fill\u parent” android:background=“#FAFAFA” 将android:orientation=“vertical”添加到第一个线性布局中尝试设置按钮宽度以填充父级。这是我看

我在顶部有两个按钮(占屏幕宽度的50%),在下面有一个ViewFlipper。鳍状肢不再出现(


android:id=“@+id/linearLayout01”
android:layout\u width=“fill\u parent”
android:layout\u height=“fill\u parent”
android:background=“#FAFAFA”

将android:orientation=“vertical”添加到第一个线性布局中

尝试设置按钮宽度以填充父级。这是我看到您的代码时唯一想到的事情。在填充父级时使用相同的权重也会使其宽度相等


还有垂直方向

完美。我之前有过,但我把它取下来,它有帮助…我想我解决了这两个问题。:)重复问题。也给出了类似的答案。
    <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>