如何将选项卡视图放在布局中间 [英] How to put tab view in middle of layout

查看:26
本文介绍了如何将选项卡视图放在布局中间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,需要以下视图图像 [1]

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

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

我的活动扩展了 AppcompactActivity 并使用了支持操作栏.所以它不能扩展 TabActivity,而且我也不想使用已弃用的 Tabactivity.

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.

推荐答案

请使用 android.support.design.widget.TabLayout 并将其放置在您的布局中间.

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

一些有用的属性:

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

这篇关于如何将选项卡视图放在布局中间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆