jpardogo / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
2.19k stars 354 forks source link

How to remove line between Toolbar and TabStrip? #62

Closed squeeish closed 9 years ago

squeeish commented 9 years ago

Image

How do I remove the grey shadow/line as shown above?

My layout is as follows:

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" app:theme="@style/ThemeOverlay.AppCompat.ActionBar" android:background="?attr/colorPrimaryDark"/>

<com.astuetz.PagerSlidingTabStrip android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="40dp" android:elevation="4dp" android:background="?attr/colorPrimary" android:textColor="@color/white" app:pstsIndicatorColor="@color/white" app:pstsShouldExpand="true" />

JcMinarro commented 9 years ago

You have to set the same "elevation" that the toolbar. To do that add the next attribute to you PSTS:


<com.astuetz.PagerSlidingTabStrip 
                .......
        android:elevation="4dp"
                .......
/>
squeeish commented 9 years ago

Hi @IGZJcMinarro, the elevation attribute is already defined though.

Might it be related to way I inflate my layouts?

The toolbar is defined in activity_main.xml which is inflated in MainActivity.java. Fragments are then inserted in by navigation drawer. I do not use <include layout.../> like done in the sample app.

jpardogo commented 9 years ago

For the white line:

pstsIndicatorHeight for container pstsUnderlineHeight for each tab

Shadow is your call, it is not part of this lib. You manage it. Either elevation or a drawable you added.

http://www.stackoverflow.com is a good place to ask this question.