Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.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使用FrameLayout xml具有不同布局位置的多个按钮_Android_Xml_Button_Mobile_Imagebutton - Fatal编程技术网

Android使用FrameLayout xml具有不同布局位置的多个按钮

Android使用FrameLayout xml具有不同布局位置的多个按钮,android,xml,button,mobile,imagebutton,Android,Xml,Button,Mobile,Imagebutton,我不熟悉安卓系统 我在玩风景画。我在屏幕中央有文字。我在文本的正下方有两个按钮(False和True),然后我尝试在屏幕的左下角有一个previous image按钮,在屏幕的右下角有一个next image按钮 问题是,由于FrameLayout中有多个布局,我无法使“下一个”和“上一个”按钮分开并位于屏幕底部的相对角落 如何修改XML重力布局属性来实现这一点?我一直把两个图像按钮都贴在最左边的每个按钮旁边 图像按钮是线性布局的子项线性布局如果不在部分子视图上使用属性android:layo

我不熟悉安卓系统

我在玩风景画。我在屏幕中央有文字。我在文本的正下方有两个按钮(False和True),然后我尝试在屏幕的左下角有一个previous image按钮,在屏幕的右下角有一个next image按钮

问题是,由于FrameLayout中有多个布局,我无法使“下一个”和“上一个”按钮分开并位于屏幕底部的相对角落

如何修改XML重力布局属性来实现这一点?我一直把两个图像按钮都贴在最左边的每个按钮旁边


图像按钮是
线性布局的子项<代码>线性布局
如果不在部分子视图上使用属性
android:layout\u weight
,则永远不会使用所有可用空间。我在这里不解释如何执行此操作,因为放弃
LinearLayout
并让
ImageButton
s成为
FrameLayout
的子项对性能更有利:

</FrameLayout>

   <!-- other Views like before ... -->

   <ImageButton
        android:id="@+id/prev_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow_left"
        android:layout_gravity="left|bottom"
        android:contentDescription="@string/prev_button" />

    <ImageButton
        android:id="@+id/next_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|bottom"
        android:contentDescription="@string/next_button"
        android:src="@drawable/arrow_right" />

</FrameLayout>

</FrameLayout>

   <!-- other Views like before ... -->

   <ImageButton
        android:id="@+id/prev_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/arrow_left"
        android:layout_gravity="left|bottom"
        android:contentDescription="@string/prev_button" />

    <ImageButton
        android:id="@+id/next_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|bottom"
        android:contentDescription="@string/next_button"
        android:src="@drawable/arrow_right" />

</FrameLayout>