我想加上左侧搜索按钮的设置弹出,但我无法在工具栏添加。
I am trying to add search button on left side of settings pop up but i am not able to add in toolbar.
下面是menu.xml文件我的code:
Here is my code of menu.xml :
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.materialtheme.MainActivity" >
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_launcher"
android:menuCategory="secondary"
android:showAsAction="ifRoom"
android:title="@string/action_search"/>
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>
和这里是我的toolbar.xml:
and here is my toolbar.xml :
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:elevation="4dp"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
我得到的工具栏,但没有得到搜索按钮?
I am getting toolbar but not getting search button ?
使用应用:showAsAction =总是
与您menu.xml文件的xmlns:程序=http://schemas.android.com/apk/res-auto&GT;
菜单中的标签
上一篇:如何创建表的SQL数据库实体框架,运行时和更新模型在运行时?实体、框架、模型、数据库
下一篇:为什么没有INT过载SqlFunctions.StringConvertINT、SqlFunctions、StringConvert