Reputation: 577
I need to customize action bar to look like this photo
when click on image of right it opens slide menu from right of screen , that works fine I tried that so far
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar));
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
action_bar.xml
<?xml version="1.0" encoding="UTF-8"?>
<item>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fb"
android:shape="rectangle" >
<solid android:color="#00C78C" />
</shape>
</item>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/aslogo" />
</item>
and for search and setting icons i used this in main.xml
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
<item
android:id="@+id/action_help"
android:icon="@drawable/assetting"
android:showAsAction="always"/>
<item
android:id="@+id/action_search"
android:icon="@drawable/assearch"
android:showAsAction="always"/>
here is what i have so far
any help please
Upvotes: 3
Views: 304
Reputation: 15476
If you are using Android's native Actionbar, proper RtL is only supported post Android 4.2: change action bar direction to right-to-left
If you want to support older Android versions, you probably have to customize one of the open source actionbar libraries, and use SlidingMenu for sliding from right action.
Upvotes: 0
Reputation: 2687
ok first of all .. remove your title with
getActionBar().setDisplayShowTitleEnabled(false);
then you should use orderInCategory in your xml file and it will order from less number to greater (from left side of your action bar) ...
Upvotes: 1