So I'm trying to get my Actionbar to split, but it just won't happen here's my code I'm currently using:
Manifest:
<activity
android:name=".ChooseLocationActivity"
android:label="@string/topMenuButton"
android:uiOptions="splitActionBarWhenNarrow">
<meta-data
android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />
</activity>
Menu:
<menu 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"
tools:context="com.example.vincent.projectw.ChooseLocationActivity">
<item
android:id="@+id/mLocations"
android:title="Locaties"
android:icon="@drawable/ic_marker"
app:showAsAction="ifRoom|withText" />
<item
android:id="@+id/mSearch"
android:title="Zoeken"
android:icon="@drawable/ic_search"
app:showAsAction="ifRoom|withText" />
<item
android:id="@+id/mMap"
android:title="Kaart"
android:icon="@drawable/ic_world"
app:showAsAction="ifRoom|withText" />
<item
android:id="@+id/mAddArticle"
android:title="Toevoegen"
android:icon="@drawable/ic_add"
app:showAsAction="ifRoom|withText" />
The theme I'm using is "Theme.AppCompat.Light.DarkActionBar", and I am importing "android.support.v7.app.ActionBarActivity", I am using APK 11 but it should work since I'm using the correct metadata? So why doesn't it work?
To split your
ActionBar
for API level 14 and higher, you must specify the attributeuiOptions
on youractivity
tag (orapplication
) and notandroid:uiOptions
.This is the example from the official documentation: