Próbuję dodać przycisk wyszukiwania po lewej stronie okna ustawień, ale nie mogę dodać paska narzędzi.Jak dodać przycisk wyszukiwania na pasku narzędzi w materiale projektowym
Oto mój kod 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>
i tu jest moja 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" />
jestem coraz pasek ale nie dostaję przycisk wyszukiwania?
Proszę korzystać z tego prosty otoki;) https://gist.github.com/ademar111190/7d31dab71502e6a85b8a –