How to make tabs like Nexus one weather/news App?
is anyone have an idea how to make tabs like the nexus one tabs from the weather/news app, and i mean the functionality which by flick the screen you could go to the next tab, Thanks
Vid开发者_开发问答eo: http://www.youtube.com/watch?v=hIu6kCnZVF0
alt text http://www.gadget.pdamu.com/wp-content/uploads/2010/01/Google-Phone-Nexus-One-weather-apps.jpg
You can now do this out-of-the-box in the Android Compatibility library with a ViewPager: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html?m=1
ViewPager slides between Fragments much the same way ListViews scroll up and down with views.
If you're not interested in scrolling the tabs, there's an example in the SDK that uses a TabHost (instead of making the tabs themselves scrollable left-to-right), but you need not use a TabHost. You could, if you wanted horizontally-scrolling tabs, use a HorizontalScrollView with some buttons in it.
For an approach that doesn't use the compatibility lib, or fragments, see here: https://github.com/olibye/AndroViews
its called a Workspaces UI pattern more information about it and how to implement it here http://www.androiduipatterns.com/2011/06/android-ui-pattern-workspaces.html
精彩评论