【发布时间】:2015-05-16 11:34:27
【问题描述】:
我是新来的。我需要你的帮助,因为我什么都不知道。例如,我为我的应用程序放置了一个工具栏,而不是屏幕顶部的操作栏......现在我想在底部放置一个工具栏......那我该怎么做呢?工具栏是正确的方式,它与android 4.0+兼容? 谢谢你的回答。
编辑: 这是在屏幕顶部显示工具栏的 mainactivity.xml 的代码:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
</LinearLayout>
<FrameLayout
android:id="@+id/container_body"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<ListView
android:id="@+id/drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#FFF"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
【问题讨论】:
-
如果你有什么尝试。放一些你尝试过的代码。
-
@BoradHardik 请看我的编辑
标签: android android-activity fragment toolbar