Hi everyone I am working currently a view which need to have a view above the tabs of the actionbar or more like below the action bar itself, and a fixed footer between the tabs.
But I have not find a way to make this behaviour other than adding the footer in each fragment and the view that I want below the tabs.
Is there a way to put headers(above) and footer(below) tabs using the actionbar?
PD. I am using Sherlock actionbar
Something inbetween the Actionbar and the Actionbar tabs? AFAIK it's not possible. ABS is only used in pre HC versions. On ICS+ the default ActionBar gets used. Therefore even if you can customize the ABS Actionbar you most likely can't override the default Actionbar on ICS+.
Related
Is there any way, how to set that the Navigation Tabs will be displayed below Action-bar every-time? On my phone is the view like I want it to be - tabs below Action-bar - but on tablet are the tabs inside the Action-bar.
Is there any way how to accomplish that?
You can not force tabs to be below the action bar. You can, however, roll-your-own with a ViewPager and PagerTabStrip. See the post below:
Force stacked tabs
Also, the Android Developers docs have some info:
http://developer.android.com/training/implementing-navigation/lateral.html#PagerTitleStrip
I have Actionbar Sherlock and SlidingMenu set up in my project. I want the menu to slide in under the actionbar, so I set:
setSlidingActionBarEnabled(false);
Though, when I have the action bar Navigation Mode set up with tabs:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
They stick with the action bar instead of sliding away. That causes the issue of being able to switch tabs and the view pager switching while the menu stays open. Along with it not being the aesthetic I am going for.
Is it possible for the tabs to slide away from the action bar with the menu? Or would it just be more practical to set up a custom implementation with radio buttons?
It's not possible to have the tabs slide when you are using NAVIGATION_MODE_TABS.
The alternative is to use the ViewPagerIndicator library and the TabPageIndicator mode from that. That way the tabs are a part of the activity layout, and will slide. The downside is that the tabs won't get embedded in the action bar on larger devices or when a device is in landscape.
I add tabs and viewpager to my project.
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Everything is perfect until i set custom view of actionBar:
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowCustomEnabled(true);
....
actionBar.setCustomView(vv,layoutParams);
Perfect: ActionBar itself at the top and tabs are below the actionBar.
When i set the custom view, tabs change place and goes to top and actionBar goes to below of tabs.
What am i doing wrong? I want the actionbar stay always at the top of the screen.
You can vote for this bug on Android code:
https://code.google.com/p/android/issues/detail?id=36191
There are some tricks to avoid this that you can read here: https://github.com/JakeWharton/ActionBarSherlock/issues/327
But the official Google answer is
This is a working as intended UX decision.
(Roman Nurik).
In my app I have ActionBar with tabs and I want to make tabs translucent, but not ActionBar. Is it possible to achive this via styles and themes?
You can use custom layout and inflate it to use it as tabs
Please find it here : https://stackoverflow.com/a/10013297/951045
and to hide actionbar use
getSupportActionBar().hide(); // if you are using support lib
otherwise use getActionBar().hide();
You can also hide actionbar by using Theme.Sherlock.NoActionBar (for support lib)
I want to use Actionbarsherlock to make tabs aligned at the bottom of a layout. Where the fragment views load above it instead of below it.
How would this be done? currently in onCreate I am doing
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
getSupportActionBar().setDisplayShowHomeEnabled(false);
getSupportActionBar().setDisplayShowTitleEnabled(false);`
and do not see an obvious function in getSupportActionBar() that facilitates its position onscreen.
Insight appreciated
This cannot be done. The tabs are built-in to the action bar which always remains at the top of the screen. The action bar behavior itself is dictated by the native action bar that's built-in to Android. ActionBarSherlock only mimics its behavior on pre-ICS.
If the native action bar does not support a feature then ActionBarSherlock will not be able to support it either.
A simpler way to do this would be to place a TabWidget at the bottom of the layout and theme them to look like the ICS-style tabs.