Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.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_Android Layout - Fatal编程技术网

Android 垂直分割布局

Android 垂直分割布局,android,android-layout,Android,Android Layout,我想要一个垂直分成两部分的布局。我的应用程序始终处于横向模式 请帮忙 我试着用桌面布局 <TableLayout android:id="@+id/tableLayout1" android:stretchColumns="*" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"

我想要一个垂直分成两部分的布局。我的应用程序始终处于横向模式

请帮忙

我试着用桌面布局

 <TableLayout android:id="@+id/tableLayout1" 
 android:stretchColumns="*" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
 <TableRow android:id="@+id/tableRow1"
 android:layout_width="fill_parent" android:layout_height="wrap_content">
 </TableRow>
 </TableLayout>


我不喜欢
表格布局
,因此我将尝试向您解释如何使用
线性布局
实现这一点。您需要使用
android:orientation=“horizontal”
将布局的方向设置为水平。然后您应该在内部创建两个
linearlayout
,它们都具有
android:layout\u width=“fill\u parent”
android:layout\u weight=“1”
。然后您可以在这些布局中放置任何内容,整个视图将被拆分为两个水平部分。希望这有帮助

我将使用Egor的解决方案,但也将所有内容嵌套在一个
RelativeLayout
中,以防您想在另一个
线性布局中添加标题(这样您可以在另一个容器上添加安卓:下面)

您可以发布代码吗?我用一个表格布局尝试了它。但我做不到。我应该看起来像[|],如果你仍然想使用TableLayout check out教程,也许你可以将它调整到你的应用程序中。