I have been trying to figure out how to make an actionbar tab menu like the one pictured below. How can I make my tabs display the icon above the text as shown here? When I implement it, it displays the icon to the left of the text. Is there something akin to the compund drawable feature of TextView (android:drawableTop) I can use for the tab?
I am using a custom XML for the Main bar, and actionbarsherlock.
that is the old android tabs view, the new ones have the text on the side next to the image
Related
Im trying to change the icon to TextView and color it's background.
Actually i have icon on the left side of item, and the text with colored background on the right, using android:actionLayout.
And i want to delete the icon on the left side, and place there a text with colored background which i have currently on right side.
Any possibility?
I think you might need to create your own Navigation drawer adapter. Check answers in this thread to understand how to do it.
How to create a custom navigation drawer in android
I am following this tutorial. The tutorial basically helps to create a sliding tab menu by using the AppCompat library. It basically creates a custom toolbar using the tabs and then replaces the standard ActionBar with this toolbar.
It works perfectly, but I do not wish to show the title. I only want the tabs at the top of the screen to be my main navigation. On my activity I have set
getSupportActionBar().setTitle(null);
but this only makes the text for the title blank. Space (padding?) is still reserved for the title. How do I remove it?
The picture below shows the problem visually.
I am trying to change the style of the text in the Actionbar Tabs. When they are stacked (below the actionbar) I want the text to be black and when they are inside the actionbar, I want the text to be white. I have customized the background successfully based on this, but cannot figure out how to do it, if it's even possible.
In my app I've got three tabs in an actionbar (using ActionBarSherlock). In an xml
style I set/overwrite default background selector and everything works well. But... now I've got to set individual backgrounds for each tab. Visually I want to have my tabs with different underline color.
Ideally I'd like to have something like this:
Tab t = actionBar.newTab();
t.setBackground(...);
actionBar.addTab(t);
But there is no method setBackground.
So, I created a custom view for the tabs and now I have this:
The first problem is the size. I'd like to have exactly the same size I had with standard/default tabs.
The second problem is the background selector doesn't work. When I press a not selected tab it doesn't change its state/background, and it is the same selector that works perfectly with TabView.background.
What I'd like to have exactly is standard actionbar tabs with different background selector for each tab. Any ideas?
I have a tablet layout using ABS.
The Home (app) icon is displayed and my 4 tabs are shown to the right of it.
I'd like to insert an image (for advertising) inbetween the icon and tabs.
Does anybody know if it can be done?
Thanks in advance.
You can't insert an image between the icon and the tabs, but you could:
A. Use a logo drawable which has the icon and ad in it -- then add this by setting the android:logo attribute on your application or activity to your logo drawable.
or
B. Use a custom view and set this on the ActionBar with setCustomView(View view).