【发布时间】:2012-01-14 23:14:30
【问题描述】:
我想出了如何将菜单栏放在屏幕顶部。当我在使用 expandableListView 创建的主菜单中移动时,它会保持原位。但是,我希望菜单栏位于屏幕底部而不是顶部。我玩弄了 relativeView 并得到了底部的栏,但是,主菜单消失了。 这是我的主要 xml 文件
<?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);
我试着玩弄重力,但它什么也没做。如果您认为有帮助,我可以从我的程序中添加更多代码。
【问题讨论】:
标签: java android xml android-layout