How to put tab view in middle of layout

邮差的信 提交于 2019-12-23 04:29:43

问题


I am developing an app, requires following view image [1]

http://i.stack.imgur.com/GrNpS.png

My activity extends AppcompactActivity and using supporting action bar. so it can't extend TabActivity and also I dont want to use deprecated Tabactivity.

how can I put tabs in middle of layout, I think it may possible with fragments, is there any other way to achieve it. help me. Thanks.


回答1:


Please use android.support.design.widget.TabLayout and place it in the middle of your layout.

Some useful attributes:

android:layout_gravity="center"
android:gravity="center"


来源:https://stackoverflow.com/questions/33566805/how-to-put-tab-view-in-middle-of-layout

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