У меня есть следующее TabLayout
.
<android.support.design.widget.TabLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="100dp"
app:tabSelectedTextColor="@color/white"
app:tabBackground="@drawable/my_selector"
/>
Я установил на вкладках следующий макет как пользовательский вид.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:background="@color/red"
>
<TextView
android:id="@+id/txt"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="16dp"
android:gravity="center_vertical"
android:text="FOO"
android:textColor="@color/white"
/>
</LinearLayout>
И установили его следующим образом:
tabLayout.addTab(tabLayout.newTab().setCustomView(LayoutInflater.from(context).inflate(R.layout.my_layout, null)));
tabLayout.addTab(tabLayout.newTab().setCustomView(LayoutInflater.from(context).inflate(R.layout.my_layout, null)));
Проблема: я не могу контролировать высоту TabLayout
.Он оборачивает содержимое, пока я установил minHeight
.
Что я тут испортил?