From 84f2a0f5e7a2ae63f4bc64f494b2aa6c94e7eb5a Mon Sep 17 00:00:00 2001
From: Scott Main
<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:example.app="http://schemas.android.com/apk/res-auto" >
+ xmlns:yourapp="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"
- example.app:showAsAction="ifRoom" />
+ yourapp:showAsAction="ifRoom" />
...
</menu>
@@ -281,7 +281,7 @@ want to display the text title, add {@code "withText"} to the {@code showAsActio
attribute. For example:
-<item example.app:showAsAction="ifRoom|withText" ... /> +<item yourapp:showAsAction="ifRoom|withText" ... />
Note: The {@code "withText"} value is a hint to the @@ -372,33 +372,29 @@ items on a narrow screen, while leaving room for navigation and title elements a
To enable split action bar when using the support library, you must do two things:
res/values/styles.xml
--<style name="MyAppTheme" parent="Theme.AppCompat.Light"> - <item name="windowSplitActionBar">true<item> -</style> -+element. This attribute is understood only by API level 14 and higher (it is ignored +by older versions).
Then set this as your activity theme:
+For example:
-AndroidManifest.xml
-+<manifest ...> - <activity android:theme="@style/MyAppTheme" ...> - ... + <activity uiOptions="splitActionBarWhenNarrow" ... > + <meta-data android:name="android.support.UI_OPTIONS" + android:value="splitActionBarWhenNarrow" /> + </activity> </manifest ...>- -Using split action bar also allows navigation tabs to collapse into the @@ -571,12 +567,12 @@ the {@link android.support.v7.widget.SearchView} widget:
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:example.app="http://schemas.android.com/apk/res-auto" > + xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_search" android:title="@string/action_search" android:icon="@drawable/ic_action_search" - example.app:showAsAction="ifRoom|collapseActionView" - example.app:actionViewClass="android.support.v7.widget.SearchView" /> + yourapp:showAsAction="ifRoom|collapseActionView" + yourapp:actionViewClass="android.support.v7.widget.SearchView" /> </menu>@@ -719,11 +715,11 @@ the {@link android.support.v7.widget.ShareActionProvider} class. For example: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:example.app="http://schemas.android.com/apk/res-auto" > + xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_share" android:title="@string/share" - example.app:showAsAction="ifRoom" - example.app:actionProviderClass="android.support.v7.widget.ShareActionProvider" + yourapp:showAsAction="ifRoom" + yourapp:actionProviderClass="android.support.v7.widget.ShareActionProvider" /> ... </menu> -- cgit v1.2.3-59-g8ed1b