Search code examples
androidtabsandroid-fragmentsandroid-tabhost

TabHost and Android 4.0 ICS


I have searched for this for a long time now... I am writing an App which should be compatible between Android 2.2 and Android 4.0. Since under Android 4.0 Tabs are deprecated I was wondering what would be the right way to do it? If I still use Tabs as in my testings they look quite nice (All the same size, no icons...) but if I then run it on a 2.2 they all look pressed together (just the size of the title each tab has, maybe has to do with me using a HorizontalScrollView?) What would be the right decision here? Just using tabs for Android 2.2 and 4.0? And if yes how can I set the Tabs on 2.2 to be all the same size? Use Fragments on 4.0 and Tabs on 2.2? And if yes how would I implement this? If I should use Tabs should I only use 4 Tabs (I have between 2 and 10 - dynamically) and put an extra "More" Tab? If yes how would I do that?

I hope the question is understandable. If not feel free to ask for more information.


Solution

  • You could check out ActionBarSherlock - it provides the nice new ICS tabs for Android 2.1+ and has perfect samples.