Custom viewpager tabs with custom view, multiple fragment and layouts

拥有回忆 提交于 2019-12-23 02:07:08

问题


I want to make a viewpager which is just like latest facebook application.

and the problem is with tabs.

however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it.

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.


回答1:


You can refer to the official solution: http://developer.android.com/training/implementing-navigation/lateral.html

Or try this awsome lib: https://github.com/astuetz/PagerSlidingTabStrip



来源:https://stackoverflow.com/questions/24753854/custom-viewpager-tabs-with-custom-view-multiple-fragment-and-layouts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!