I am trying to build the ActionBar Tab with tabs bottom. Can some one please throw light on how to have the Android3+ version's ActionBar tabs at bottom?
Can some one please throw light on how to have the Android3+ version's ActionBar tabs at bottom?
AFAIK, tabs are always at the top, even with a split action bar.
AFAIK, the ActionBar is always at the top.
You might be thinking about split action bar though. This is used for phones that have smaller screens so they can take some additional items.
Related
In the app I am currently working on, I am working on implementing the translucent status bar with action bar tabs. I hide the ActionBar and only show the tabs.
My problem is that now, the system lets space for the action bar that is not there so FitsSystemWindows is making an error.
How can I fix that?
Thanks
The actual solution that time was quite dirty: I needed to set a custom padding from the top (I think it was 47dp or something like that) to the ViewPager (I think it was the ViewPager).
The real solution has come with AppCompat that fixes such issues: So use AppCompat!
I tried Android action bar with tabs. As you see in this picture:
(source: persiangig.com)
My action bar looks good in phones but in tablets it is not right, the tabs stick left. This picture shows what I mean, how can I put the tabs to center in tablets too?
(source: persiangig.com)
The tabs are aligned left because, in Android, the action bar is used for both navigation and Activity- or Fragment-specific actions. You don't have any in this screenshot, but menu actions that are added to the action bar will be aligned to the right.
If you must have your tabs centered for some reason, you'll have to write your own action bar. I would recommend against this, since it's a lot of work to intentionally go against user expectations. Instead, use Android's built-in action bar layout and design your app to accommodate it.
I've made an ActionBar with action ActionBarSherlock and I've spitted it with
android:uiOptions="splitActionBarWhenNarrow"
How can I position the items now? All my items are at the bottom ActionBar, I want some at the top and some at the bottom ...
As per the ActionBar guide:
Split action bar provides a separate bar at the bottom of the screen to display all action items when the activity is running on a narrow screen (such as a portrait-oriented handset).
If you want items on both the top ActionBar and buttons along the bottom, then you should use a regular ActionBar and add the buttons as a custom layout (perhaps using the android.R.attr.borderlessButtonStyle). However, you will not get the auto-collapsing into a single ActionBar on larger devices, but that can easily be done by creating a menu/layout specifically for wider devices using a selector like layout-w480dp on v14+ devices.
For my application , I'm planning to have a design as this:
http://img811.imageshack.us/img811/7045/problemel.png
-Design needs to have a title bar which is indeed the action bar in android. To overcome the compatibility issues, I used the sherlock action bar which is said to support older versions that dont have action bars. I havent tested yet for the older devices however.
-As far as I know, for navigation , we could rather use tabbed or dropdown list methods. I want to have constant tabs for every page in my app to stand below the page. This reflects the tabbed action bar, however I want it below not just under the action bar. I don't know how but youtube application somehow has it in the middle of the screen (if it's not a custom view). So how do we have tabs positioned in the bottom of the page?
-Also I want to have another menu, whose items depend on the page it's on. But the apperance will be the same for every page. In the picture on the left this menu has buttons as "Bt 1" ,"Bt 2". I dont want to repeat the same xml for every activity page, but I'm not sure how to achieve it without repeating. If the action bar allowed using both navigation tabs and the drop down list, I could put the items of this menu in the dropdown list just as the picture on the right (onto the gray button). But I guess it does not?!
Therefore I have to repeat the menu xml code in every page or is there another smart way?
Any advice will be appreciated.
This can be achieved not with tabs but by adding items to a linear_layout with a gravity of bottom but it is a bad practice as #D_Steve595 stated and should be avoided in android designs.
actionBar.setHomeButtonEnabled(false);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
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.