I am working on an app where I am using ActionbarSherLock.
As per the requirements I want the Tabs at bottom,
but by default tabs appears at the top.
How I can set the tabs at the bottom...
Related
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.
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.
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);
currently i am using ActionbarSherlock.
Right now, my apps has a Bar at top and a bar at the bottom with overflowed buttons.
I want a custom header bar and do not want to try to theme the Actionbar header bar, but I want to keep the bottom bar with the buttons.
Is it possible to hide the Header bar portion of the ActionBar?
ActionBar().hide() hides both top and bottom bars.
According to the action bar doc ("Using split action bar"): add uiOptions="splitActionBarWhenNarrow" to the corresponding manifest element. Then use setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false). The tabs move are moved into the - now empty - top bar.