How to customize PagerTabStrip
Asked Answered
C

0

6

Here is the screen that I would make :

layout-tabbar

I'm not sure how to do it and if it's possible !

Indeed I would use a ViewPager & PagerTabStrip like xml below

<?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>

Precision : Content must be scrollable and can use swipe left or right (=ViewPager)

But I'm not sure if I'm able to change the background of selected "Tab" and the "Tab Indicator" position.

Also, currently I'm not sure if I will have only 3 tab. This is why I would use "PagerTabStrip", to do as Google Play application with his scrollable tabbar.

Finally, if I can't customize as I want, I think to use "TabHost" but Its not working with "ViewPager", am I right ?

If you have better solution, I will consider it.

Catheycathi answered 22/7, 2015 at 14:53 Comment(1)
I stumbled into similar requirement. Did you get answer?Cassino

© 2022 - 2024 — McMap. All rights reserved.