我想出了如何让屏幕顶部的菜单栏。当我移动使用expandableListView创建的主菜单时,它保持原位。不过,我希望菜单栏位于屏幕的底部而不是顶部。我用relativeView玩了一下,然后在底部找到了吧,但是主菜单消失了。 这里是我的主XML文件使用ExpandableListView在屏幕底部放置一个菜单栏
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/buttonbefore"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="back" />
<Button
android:id="@+id/buttonnext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="Next" />
</LinearLayout>
<ExpandableListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<TextView
android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/main_no_items" />
然后我用这对Java得到它出现在我的计划。
LinearLayout bottomMenu = (LinearLayout)findViewById(R.id.buttons);
我试图玩弄的严重性,它什么也没做。如果您认为它有帮助,我可以从我的程序中添加更多代码。
谢谢,我需要添加另一个LinearLayout并将按钮作为第二个LinearLayout – Aaron 2012-01-15 01:13:37