0

I would like to make a custom action bar similar to the following:

Custom action bar with home and menu swapped

I have seen the questions How to align items in action bar to the left? and Positioning menu items to the left of the ActionBar in Honeycomb, but they don't seem to answer my question.

When I am in portrait mode I have a split screen. The menu icons are on the bottom and the top looks like the right side of the above image. However, in landscape mode the icons crowd in on the right of the app icon. I would like them to display on the left side.

Here is my current xml for the action bar:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:id="@+id/appIcon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:src="@android:drawable/ic_app" />

    <TextView
        android:id="@+id/tvAppTitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toLeftOf="@+id/appIcon"
        android:text="@string/app_name" />

</RelativeLayout>
Community
  • 1
  • 1
Suragch
  • 935
  • 3
  • 9
  • 15

1 Answers1

0

Since I couldn't find a solution using the Action Bar, I am hiding the Action Bar with

<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>

in styles.xml and then creating a custom layout to mimic having an action bar on top and bottom in portrait and only on top in landscape.

Suragch
  • 935
  • 3
  • 9
  • 15