android - 设置材质选项卡布局的样式
问题描述
我正在使用 kotlin 在我的 android 应用程序中进行材料设计。我想知道如何设置我的标签布局,就像它在下面显示的图像中一样。谢谢!
<com.google.android.material.tabs.TabLayout
android:id="@+id/profileFreelancerTabLayoutCu"
style="@style/Widget.AppCompat.Light.ActionBar.TabBar"
android:layout_width="wrap_content"
android:layout_height="60dp"
app:tabTextColor="@color/colorPrimary"
android:layout_marginVertical="20dp"
android:layout_marginHorizontal="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/registeredOnValueProfileFreelancerCu"
/>
解决了:
<com.google.android.material.tabs.TabLayout
android:id="@+id/profileFreelancerTabLayoutCu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextColor="@color/colorPrimary"
android:layout_marginVertical="20dp"
android:layout_marginHorizontal="60dp"
app:tabIndicatorGravity="stretch"
app:tabIndicator="@drawable/tab_indicator_shape"
android:background="@drawable/thicker_stroke_tab_layout"
app:tabSelectedTextColor="@color/colorWhite"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginBottom="10dp"
app:layout_constraintTop_toBottomOf="@+id/registeredOnValueProfileFreelancerCu"
/>
解决方案
推荐阅读
- python - 如何删除文本文件中的某些字符并在 python 中在它们之间创建一条线
- java - 我被困在使用 selenium java 做 UI 对齐问题
- sql-server - TLS 1.2 SQL Server 和 Delphi 客户端
- sql - PostgreSQL 选择最常见的两列组合
- r - 如何创建一个依赖于多列值的虚拟变量?
- c++ - C++ 新手无法弄清楚我哪里出错了。预期的不合格 ID:23
- docker - Docker 坏网关中的 InfluxDB
- rendering - 使用 Cycles 时渲染不会在搅拌机中开始
- tensorflow - TensorFlow/Keras的默认tmp目录怎么改?
- python - 有没有什么功能或方法可以清除python程序中正在运行的控制台?