我遇到了这个问题:我正在使用操作栏导航抽屉,但我想在菜单栏中添加一个按钮,就像这些按钮:
http://screenshots.en.sftcdn.net/blog/en/2013/06/notifications-b.png
这是我的xml文件:
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
所以,我知道添加按钮是这样的:
xmlns:yourapp="http://schemas.android.com/apk/res-auto" >
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"
yourapp:showAsAction="ifRoom" />
但我仍然不知道如何适应这两个部分,任何人都可以帮助我吗?