Android 线性布局';它紧挨着彼此
我试图有两个线性布局的旁边彼此,但下面的代码无法工作,它把他们这样一个是在顶部 你能帮忙吗。还是你有更好的主意 谢谢Android 线性布局';它紧挨着彼此,android,Android,我试图有两个线性布局的旁边彼此,但下面的代码无法工作,它把他们这样一个是在顶部 你能帮忙吗。还是你有更好的主意 谢谢 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <L
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.5"
android:background="#999">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="0.5"
android:background="#977000">
</LinearLayout>
</LinearLayout>
尝试将第一个线性布局设置为“水平”,而不是“垂直”尝试将第一个线性布局设置为“水平”,而不是“垂直”<
android:orientation="vertical" >
一定是
android:orientation="horizontal" >
在您的外线布局中此
android:orientation="vertical" >
android:orientation="horizontal"
一定是
android:orientation="horizontal" >
在您的外部线性布局中用
android:orientation=“vertical”
替换顶部LinearLayout中的android:orientation=“horizontal”
用android:orientation=“horizontal”
替换顶部线性布局中的android:orientation=“vertical”
android:orientation="horizontal"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:background="#999">
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:background="#977000">
</LinearLayout>
</LinearLayout>
使用此项仅需更改android:orientation=“horizontal”
即可代替android:orientation=“vertical
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:background="#999"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:background="#977000"
android:orientation="horizontal" >
</LinearLayout>
使用此项仅需更改android:orientation=“horizontal”
即可代替android:orientation=“vertical
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:background="#999"
android:orientation="horizontal" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:background="#977000"
android:orientation="horizontal" >
</LinearLayout>
将外部线性布局的方向设置为“水平”。。它工作将外部线性布局的方向设置为“水平”。。它起作用了