我有我的应用程序一个TabLayout和它拥有的自定义视图:机器人 - TabLayout动态调整
<?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">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal">
<com.myproject.app.utils.commons.IconImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginRight="14dp"
android:layout_marginEnd="14dp"
app:iconStateListColor="@color/color_order_tab"/>
<TextView
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_order_tab"
android:textSize="14sp"
android:fontFamily="sans-serif-medium"/>
</LinearLayout>
</RelativeLayout>
我想,只有当它选择在标签上显示的文本 - 已经完成的 - 并动态调整这些选项卡,有没有办法做到这一点? 如果我使用app:tabMode="fixed"
选项卡不调整大小,如果我使用app:tabMode="scrollable"
我的选项卡总是在我的屏幕左侧。如果我做android:layout_width="wrap_content"
和android:layout_gravity="center_horizontal"
- TabLayout不填满整个屏幕.. 所以我需要:
- 调整分页大小的文本时出现或消失;
- 任何情况下,标签都应该填满屏幕。
你怎么隐藏未使用这个应用程序时的文字:tabSelectedTextColor =“机器人:ATTR/textColorPrimary” 应用:tabTextColor =“@安卓:彩色/透明” – Killer
不,我隐藏文本与设置文本= “”,空字符串。 – Den
请检查答案 – Killer