ogaclejapan / SmartTabLayout

A custom ViewPager title strip which gives continuous feedback to the user when scrolling
Apache License 2.0
7.09k stars 1.34k forks source link

app:stl_defaultTabBackground can not set drawable?? #152

Closed 401885064 closed 8 years ago

401885064 commented 8 years ago

this is my xml:

<com.ogaclejapan.smarttablayout.SmartTabLayout android:id="@+id/viewpagertab" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="0dp" android:layout_height="40dp" android:layout_marginLeft="50dp" android:layout_marginRight="50dp" android:layout_weight="1"

    app:stl_clickable="true"
    app:stl_defaultTabBackground="@drawable/top_of_the_column"
    app:stl_defaultTabTextAllCaps="true"
    app:stl_defaultTabTextColor="@drawable/home_viewpager_indivator_txtview_color"
    app:stl_defaultTabTextHorizontalPadding="16dp"
    app:stl_defaultTabTextMinWidth="0dp"
    app:stl_defaultTabTextSize="14sp"
    app:stl_distributeEvenly="true"

    app:stl_dividerColor="@color/home_tab_line_selected_color"
    app:stl_dividerThickness="0dp"
    app:stl_drawDecorationAfterTab="true"

    app:stl_indicatorAlwaysInCenter="false"
    app:stl_indicatorColor="@color/home_tab_line_selected_color"

    app:stl_indicatorCornerRadius="0dp"
    app:stl_indicatorGravity="bottom"

    app:stl_indicatorInFront="false"
    app:stl_indicatorInterpolation="linear"
    app:stl_indicatorThickness="1dp"
    app:stl_indicatorWidth="40dp"
    app:stl_indicatorWithoutPadding="true"

    app:stl_overlineColor="@color/home_tab_line_selected_color"
    app:stl_overlineThickness="0dp"

    app:stl_titleOffset="24dp"
    app:stl_underlineColor="#4D000000"
    app:stl_underlineThickness="0dp"
    />

when app:stl_defaultTabBackground="@drawable/top_of_the_column"

is no my want their layout_width is to be wrap_content no my set android:layout_width="0dp" android:layout_weight="1"

when i change app:stl_defaultTabBackground="@android:color/white" , it will well . i so understand why it is??

ogaclejapan commented 8 years ago

Hi, @401885064 I'm sorry late reply. I’ve been busy lately at work :P

It was already resolved?

Please use the custom layout. If you use the app:stl_distributeEvenly="true", default tab will be android:layout_width="0dp" android:layout_weight="1"