我刚开始使用
Android并拥有以下代码.我想在屏幕底部显示三个按钮而不更改为相对布局.我尝试设置内部线性布局的layout_weight和gravity,但这会将按钮放在手机三个菜单按钮后面的底部.如何在菜单按钮上方显示它们?任何帮助,将不胜感激.
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:id="@+id/search_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search_box" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingTop="80dp"
android:text="@string/welcome"
android:textSize="24sp" />
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="bottom"
android:orientation="horizontal">
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/buttonB1" />
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/buttonB2" />
style="?android:attr/buttonBarButtonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/buttonB3" />
左图显示了我想要移动到底部的按钮.右图显示我尝试这样做但按钮最终部分位于系统菜单按钮后面.