6

これが私が作る画面です:

レイアウトタブバー

私はそれを行う方法がわかりませんし、それが可能かどうかもわかりません!

実際、以下のxmlのようなViewPagerとPagerTabStripを使用します

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.view.PagerTabStrip
        android:id="@+id/pager_title_strip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:background="@color/white"
        android:paddingBottom="4dp"
        android:paddingTop="4dp"
        android:textColor="@color/primary_text" />

</android.support.v4.view.ViewPager>

精度 : コンテンツはスクロール可能で、左右にスワイプできる必要があります (=ViewPager)

しかし、選択した「タブ」の背景と「タブインジケーター」の位置を変更できるかどうかはわかりません。

また、現在、タブが 3 つしかないかどうかはわかりません。これが、「PagerTabStrip」を使用して、スクロール可能なタブバーを備えた Google Play アプリケーションとして使用する理由です。

最後に、思い通りにカスタマイズできない場合は、「TabHost」を使用すると思いますが、「ViewPager」では機能しません。

より良い解決策があれば、検討します。

4

0 に答える 0