屏幕底部的菜单栏/工具栏在android中
答
使用带有alignParentBottom一个的LinearLayout =“真”
事情是这样的:
<RelativeLayout
android:id="@+id/mainLyt"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Some layout things -->
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/bottomBar">
<!-- some scrolling content -->
</ScrollView>
<LinearLayout
android:id="@+id/bottomBar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<!-- Some Buttons -->
</LinearLayout>
</RelativeLayout>
我没有尝试编译,您可能需要修正一些拼写错误,但是这是一个基本的想法你可以实现你正在尝试做的事情。
答
onCreat后使用以下几行。
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.home_screen);
感谢您的回复。如果我把一个滚动视图?工具栏没有固定在按钮上。 – Lestr1992 2013-03-05 02:08:51
由于'layout_alignParentBottom =“true”'参数,它被固定在底部。我将编辑我的示例代码,以包括滚动视图,一秒 – FoamyGuy 2013-03-05 02:10:06
好的,谢谢:) – Lestr1992 2013-03-05 02:10:49