现在它垂直拆分...我希望它水平拆分。我看过其他所有人都说他们的水平切割,但我无法分辨其中的区别...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="top"
android:layout_weight="1" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_weight="1" >
</LinearLayout>
</LinearLayout>
最佳答案
将方向更改为垂直
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:layout_weight=".1" >
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_weight=".1" >
</LinearLayout>
</LinearLayout>
关于android - 如何在屏幕上水平分割屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12934712/