【发布时间】:2016-10-14 18:25:25
【问题描述】:
我试图在事件发生后在屏幕底部设置一个工具栏,但工具栏绑定到屏幕顶部。知道如何将其设置在屏幕底部吗?
app:theme="@style/Base.Theme.AppCompat.CompactMenu" >
<RelativeLayout
android:id="@+id/toolbarmenucontainer"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:weightSum="3"
android:layout_height="match_parent"
android:orientation="horizontal" >
<Button
android:layout_width="1dp"
android:layout_height="match_parent"
android:clickable="true"
android:scaleType="fitXY"
android:layout_weight = "1"
android:text="test" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:clickable="true"
android:scaleType="fitXY"
android:layout_weight = "1"
android:text="test2" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
【问题讨论】:
-
Toolbar 就像任何其他 ViewGroup。将它包裹在一个 RelativeLayout 中并与父底部对齐。
-
能贴出完整的xml布局代码吗??