【发布时间】:2015-09-17 15:09:30
【问题描述】:
我关注了this tutorial。我做了简单的更改,在屏幕底部显示 TabLayout。
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager_landing"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="@android:color/white" />
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs_landing"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed" />
</LinearLayout>
问题:-
TabIndicator 显示在屏幕底部运行良好,现在我想在选项卡顶部而不是底部显示 TabIndicator。
使用自定义布局,我们可以按照教程中的说明进行操作,但是是否有任何 xml 属性会在顶部显示 TabIndicator ?
【问题讨论】:
-
输入你的xml代码。谢谢
-
@Fakher 我已经发布了 xml
-
@Nilesh 你做到了吗?我还想在顶部显示标签指示器。
-
@NiteshKhatri 不是默认情况下,因为现在我已经为此做了自定义布局
-
请参考here.的解决方案
标签: java android android-support-library androiddesignsupport