2
レイアウトは正しく表示されていませんが、2つのタブのみでSlidingTabsを作成しました。 Image 1
は、私は常に取得し、出力されImage 2
私は出力がTabLayoutのタイトルが正しく表示されない
出力
の予想される出力
layout.xml
を達成するために期待しています<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/pager_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" />
</FrameLayout>
<test.com.example.view.SlidingTabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:paddingTop="?attr/actionBarSize" />
</FrameLayout>
try 'tabs.setDistributeEvenly(true);' –