屏幕底部的菜单栏/工具栏在android中

问题描述:

enter image description here屏幕底部的菜单栏/工具栏在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> 

我没有尝试编译,您可能需要修正一些拼写错误,但是这是一个基本的想法你可以实现你正在尝试做的事情。

+0

感谢您的回复。如果我把一个滚动视图?工具栏没有固定在按钮上。 – Lestr1992 2013-03-05 02:08:51

+0

由于'layout_alignParentBottom =“true”'参数,它被固定在底部。我将编辑我的示例代码,以包括滚动视图,一秒 – FoamyGuy 2013-03-05 02:10:06

+0

好的,谢谢:) – Lestr1992 2013-03-05 02:10:49

onCreat后使用以下几行。

super.onCreate(savedInstanceState); 
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
    setContentView(R.layout.home_screen);