自viewpager标签与自定义视图,多个片段和布局 [英] Custom viewpager tabs with custom view, multiple fragment and layouts
问题描述
我想打一个viewpager这就像最新的Facebook应用程序。
I want to make a viewpager which is just like latest facebook application.
和问题是标签。
不过,我想做到最好的,但我需要的图标,与之相关的选项卡和多个片段和布局文本。
however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it.
发生了两期,当我试图发展。
1.我妥协与我的用户界面,并试图把静态的图标,但他们不选择改变,他们甚至没有徽章像Facebook应用程序。
2.当我把那个code在我,我已经开发了演示程序的应用程序,它会显示错误和研究后,我发现,我的应用程序没有一个动作条。于是有人呼吁后给错误 getActionBar
。
two issue occurred when i tried to develop.
1. I compromised with my UI, and tried putting static icons in it, but they don't change on selection and they don't even have badge like in facebook application.
2. when i put that code in my application which i have developed in demo app, it shows error and after researching i found that my application don't have an actionbar. so it was giving error after calling getActionBar
.
请有人能提供任何例子或链接到它可以帮助我。
please someone can provide any example or link to that which can help me.
推荐答案
您可以参考官方的解决办法:的 http://developer.android.com/training/implementing-navigation/lateral.html
You can refer to the official solution: http://developer.android.com/training/implementing-navigation/lateral.html
或者试试这个要命的lib: https://github.com/astuetz/PagerSlidingTabStrip
Or try this awsome lib: https://github.com/astuetz/PagerSlidingTabStrip
这篇关于自viewpager标签与自定义视图,多个片段和布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!