I am trying to create app that has tabs which look like this one:
I know that it is possible to use fragments and tab indicators in actionbar but is this the best approach for this? I am using theme with noActionBar. I thought that I could use tabhost for this but I dont know if this is the best approach.
Thanks in forward
Related
I have been familiar with TabHost/TabSpec to create application with tabs. I noticed that there are more than one option to create tabs:
1- Tabs in action bar
2- Viewpager (I guess google calls it horizontal pager)
3- And offcourse the tabhost/tabspec approach.
I tried to read google docs but it is like everywhere so I got further confused.
When would you use what or is there one that is the norm?
Thanks
You should use a Toolbar with a ViewPager to simulate tabs (all wrapped in an AppBarLayout). The result will look something like this:
You can read more about this type of design on the Material Design spec: https://www.google.com/design/spec/components/tabs.html#tabs-usage
Also, here is a good tutorial on how to implement tabs within a ViewPager: http://blog.grafixartist.com/material-design-tabs-with-android-design-support-library/
I would like to insert an image between the ActionBar and ActionBar Tabs. What is the best way do it?
I'm using actionbarsherlock.
Thanks.
After doing a bunch of research, I found there is no way to make this work with native ActionBar tabs. So save yourself some time, create your own TabHost and place it below the image. Then implement tabchange listeners, etc.
Use a layout above actionbar tab having your image or just take imageview above it.
I would like to know which will be the best method to create custom tabs in Android 2.2. something like this.
I know about the TabHost but not satisfied with its UI. I would like to create my own tab UI in 2.2 like shown in the above pic. Please suggest me the best and easy method to do this.
Create a custom view for your tab complete with state lists drawables and more!
Best tutorial for you:
http://joshclemm.com/blog/?p=136
And this is a example code:
http://code.google.com/p/android-custom-tabs/
ActionBarSherlock has tab feature. You can download Demos Sample from here and look at Tab Navigation Sample. I think you can find it useful.
I am creating an app where i would like to use both the drop down list navigation and tab navigation on an actionbar. But i can not figure out how to do this without implementing the actionbar as a custom view which would mess up a lot of the nice built in features.
So what is the best way to get both of these navigation modes at the same time?
Android will not build both of these for you. You can use the ViewPagerIndicator library to make an emulated tab bar for a ViewPager, which is probably the easiest way to do this.
Could anyone suggest the best way I would mimmic the styling of the android tabs? e.g these tabs...
I've basically got a RelativeLayout with a Textview inside and I want to make my RelativeLayout look like the android tabs. How would I design this? What's the best way to go about this?