垂直拆分布局Android

tes*_*123 2 android android-layout

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

请帮忙.

我用tablelayout试了一下.

 <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>
Run Code Online (Sandbox Code Playgroud)

Ego*_*gor 6

我不是粉丝TableLayout,所以我会试着用你来解释如何实现这个目标LinearLayout.您需要使用布局的方向设置为水平android:orientation="horizontal".然后你应该创建两个LinearLayouts内部,两个android:layout_width="fill_parent"android:layout_weight="1".然后你可以在这些布局中放置任何东西,整个视图将分成两个水平部分.希望这可以帮助!