4

I have searched a lot how to position ActionBarSherlock to the bottom of the screen and Thanks God it works using this code

<activity
   android:name=".MyActivity"
   android:uiOptions="splitActionBarWhenNarrow" >
</activity>

but with a small problem that the header is still there and I want to remove it also, so can any one please help me remove the header of ActionBarSherlock

Thanks in Advance

Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175

1 Answers1

2

splitActionBarWhenNarrow means that it will be split, not moved anywhere and only when narrow. Thus if you are in portrait or wide screen the menu options will always appear at the top. You cannot force ActionBar to be drawn at the bottom. Instead you might want to disable ActionBar completely and putting your own custom view at the bottom with ImageButtons with actionButtonStyle

<style name="NoActionBar" parent="@android:style/Theme.Holo.Light">
    <item name="android:windowActionBar">false</item>
    <item name="android:windowNoTitle">true</item>
</style> 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_toLeftOf="@+id/buttons_holder"
        android:ellipsize="end"
        style="@style/TextAppearance.Sherlock.Widget.ActionBar.Title"/>

    <LinearLayout
        android:id="@+id/buttons_holder"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentRight="true" >

        <ImageButton
            android:id="@+id/acion_add"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/menu_label_add"
            style="?attr/actionButtonStyle" />

        <ImageButton
            android:id="@+id/action_prev"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/menu_label_prev"
            style="?attr/actionButtonStyle" />

        <ImageButton
            android:id="@+id/action_next"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/menu_label_next"
            style="?attr/actionButtonStyle" />

    </LinearLayout>

</RelativeLayout>
Yaroslav Mytkalyk
  • 16,950
  • 10
  • 72
  • 99