I followed a tutorial on getting actionbars in my app. But even when I put android:uiOptions="splitActionBarWhenNarrow"
in my Manifest file it still keeps it at the top. Anyone has any ideas on what to do with this code?
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#f0f0f0"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/myFragments"
android:layout_width="match_parent"
android:layout_height="0dp">
</LinearLayout>
</LinearLayout>
Manifest File:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.alotoftesting"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:uiOptions="splitActionBarWhenNarrow">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The google default action bar does not in any case appear on the bottom. As it seems others have mentioned,
splitActionBarWhenNarrow
only puts a subset of yourActionBar
(like tabs, etc) on the bottom of the screen when the device is narrow. Unfortunately, if you want to implement an ActionBar like interface on the bottom of the screen, you'll have to implement it yourself (a quick search finds this example), as I haven't seen any Libraries to do this for you.In all, though, I would recommend against it, as it violates the Seamlessness design principle in the design documents by breaking user expectations of where ActionBar type controls will be - An android user is ideally used to doing things a certain way, and you would need a pretty compelling reason to break that expectation.
According to this comment:
If you would like to have a custom bottom toolbar, please check my answer to this question (added below):
I think in that way you can also put tabs at the bottom if needed.
If you have any question please free to ask.
Hope it help