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教程,也许你可以将它调整到你的应用程序中。