It is difficult for me to execute custom tabs for the action bar: I need to make tabs (I mean buttons) to use custom graphics for normal and selected states.
I was able to kill all the native styles using
<style name="customActionBarTabStyle"> <item name="android:background">#00000000</item> </style>
and then use Tab.setIcon () so that the tabs look the way I need, but I need them to respond to the switch (by switching between the two Drawables - for the on and off state).
I tried to create a Drawable selector as follows:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/btn_on" /> <item android:drawable="@drawable/btn_off" /> </selector>
but the tabs do not switch to pressed mode when selected.
Also, I tried calling Tab.setIcon () on TabListener.onTabSelected () and .onTabUnselected () - no luck either.
Does anyone know a good solution for this?
In addition, I need to display the user view instead of the overflow menu - I have already gathered a lot of “tips” to rethink my interface, to “follow the Android image”, but the problem is that the user interface is not relevant to rethink - this is the client :) , so I would love to find a way around the flaws of the ActionBar.
Any suggestions are greatly appreciated, thanks in advance.
source share