Closed subhanshuja closed 9 years ago
Hi, @subhanshuja
Of course you can place the indicator on bottom.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/viewpagertab"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
android:layout_alignParentBottom="true"
app:stl_distributeEvenly="true"
app:stl_dividerThickness="0dp"
app:stl_indicatorInterpolation="smart"
app:stl_indicatorThickness="0dp"
app:stl_underlineThickness="0dp" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/viewpagertab" />
</RelativeLayout>
oh i just change the position of parent, thank you @ogaclejapan
thank you for your @ogaclejapan tips last week, but now i have a problem with position of indicator thickness
and i had tried to change position with gravity and it doesn't change, it this my code, please help me again
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg_app"
android:weightSum="2">
<include layout="@layout/toolbar"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1.8">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="0.21"
android:background="@color/redPrimary">
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/indicator"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:stl_customTabTextLayoutId="@layout/custom_circle"
app:stl_dividerColor="@android:color/transparent"
app:stl_dividerThickness="0dp"
app:stl_indicatorAlwaysInCenter="false"
app:stl_indicatorColor="@color/orange"
app:stl_indicatorCornerRadius="16dp"
app:stl_indicatorInterpolation="linear"
app:stl_indicatorGravity="center"
app:stl_indicatorThickness="16dp"
app:stl_underlineColor="@android:color/transparent"
app:stl_underlineThickness="0dp"/>
</LinearLayout>
</LinearLayout>
Hi, @subhanshuja If you fix here, I think that it is displayed correctly.
...
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/indicator"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
...
/>
...
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/indicator"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
app:stl_indicatorAlwaysInCenter="true"
app:stl_customTabTextLayoutId="@layout/custom_circle"
app:stl_dividerColor="@android:color/transparent"
app:stl_dividerThickness="0dp"
app:stl_indicatorColor="@color/orange"
app:stl_indicatorCornerRadius="16dp"
app:stl_indicatorInterpolation="linear"
app:stl_indicatorGravity="center"
app:stl_indicatorThickness="16dp"
app:stl_underlineColor="@android:color/transparent"
app:stl_underlineThickness="0dp"/>
and the result are
Hi, @subhanshuja
android:orientation
must be vertical
.
layout_gravity
is because not activated.
<LinearLayout
...
android:orientation="vertical"
...
>
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:layout_width="wrap_content"
...
android:layout_gravity="center_horizontal"
...
/>
</LinearLayout>
Because it is not in the library of the problem, to close.
oke thank you for your help @ogaclejapan
can i put indicator on bottom of app? and how because your sample is on the top of app thank you