【发布时间】:2016-02-25 15:07:42
【问题描述】:
我想为我的应用程序创建自定义选项卡布局。问题是我无法设置相同的高度。
请帮忙解决问题。
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/tab_height"
android:background="@color/colorAccent"/>
custom_tab.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/tabIcon"
android:layout_width="30dp"
android:layout_height="30dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:background="@drawable/white_circle"
android:gravity="center"
android:text="2"
android:textColor="@color/colorAccent"/>
</FrameLayout>
<TextView
android:id="@+id/tabName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@drawable/tab_text_selection_states"
android:textSize="14sp"/>
</LinearLayout>
【问题讨论】:
标签: android material-design android-tablayout