需要关于Android布局的解释吗
我想创建如下视图: 我尝试了这种布局架构:需要关于Android布局的解释吗,android,layout,Android,Layout,我想创建如下视图: 我尝试了这种布局架构: <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView> // The blue top bar <ScrollView android:layout_width="fill_pare
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView> // The blue top bar
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" ></ScrollView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
</TextView>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
</TextView>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Description"
android:gravity="center_horizontal">
</TextView>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
</TextView>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Place"
android:gravity="center_horizontal">
</TextView>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
</TextView>
</LinearLayout>
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:gravity="bottom">
<ImageView android:layout_width="wrap_content"
android:layout_height="40dp"
android:clickable="false"
android:scaleType="center" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:gravity="left"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:text="Button 1" />
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:text="Button 2" />
<Button
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:text="Button 3" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
//蓝顶酒吧
但由于某些原因,这将不起作用,首先它不会在底部栏中显示我想要的按钮
我是Android开发的初学者,所以请帮助我
<LinearLayout
android:id="@+id/placeLayout"
...
/>
<Button
android:id="@+id/button1"
android:layout_below="@+id/placeLayout"
... />
<Button
android:id="@+id/button2"
android:layout_below="@+id/placeLayout"
android:layout_toRightOf="@+id/button1"
...
/>
<Button
android:id="@+id/button3"
android:layout_below="@+id/placeLayout"
android:layout_toRightOf="@+id/button2"
...
/>
下面是一个完整的参数列表,您可以使用它来“告诉”每个元素必须放置的位置:我的建议,使用线性布局,并使用“android:weightSum”(主布局)和“android:layout\u weight”(内部视图)属性,一开始可能会很复杂,但以后它将是适合任何屏幕的最佳方法。 检查此线程: 使用这种技术,您可以告诉主布局中的每个内部视图(或布局)它应该填充多少空间
i、 e:如果主布局的android:weightSum=1,而每个内部视图的android:layout\u weight=0.33,则表示每个内部视图占可用总空间的1/3。您也可以在内部布局中应用相同的技术:)(对于按钮)。