我正在尝试将一个布局附加到每个活动的底部,如下所示:
然而,它没有将它放在底部。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<include
android:id="@+id/bottom_Menu"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
layout="@layout/bottom_menu" />
</RelativeLayout>
然而,它没有将它放在底部。
----编辑-----
<?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="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center" >
<ToggleButton
android:id="@+id/scheduleToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/SchedueToggle" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center" >
<ToggleButton
android:id="@+id/exhibitorsToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/exhibitorsToggle" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center" >
<ToggleButton
android:id="@+id/speakersToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/speakersToggle" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center" >
<ToggleButton
android:id="@+id/MapsToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MapsToggle" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_gravity="center" >
<ToggleButton
android:id="@+id/OtherToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/OtherToggle" />
</LinearLayout>
</LinearLayout>
bottom_menu.xml
是什么样子的? - codeMagic