我在我的操作栏选项卡中使用了自定义视图来显示进度条。我希望进度条的宽度与标签指示器的宽度相匹配。然而,自定义视图所覆盖的区域在选项卡内设置了边距,因此我无法将进度条扩展到整个选项卡的宽度。有什么好的方法吗?
以下是当前进度条的样子...
进度条的宽度已设置为匹配父级宽度。
以下是当前进度条的样子...
![progress bar in tab](https://i.imgur.com/mp7ee.png)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="0dp"
>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tab_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text = "Day 1"
android:textAllCaps="true"
android:textStyle="bold"
android:textSize="13dp"
android:layout_gravity="center"
android:gravity="center"
android:paddingTop="18dp"
/>
<ProgressBar
style="@android:style/Widget.Holo.ProgressBar.Horizontal"
android:id="@+id/tab_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="1dp"
/>
</RelativeLayout>