我曾经通过编辑可绘制的png文件来删除文件外部的填充,对Holo进度条做了同样的事情,但是我找不到Material Bar的png可绘制文件。如果有人能指点我如何找到它,那就太好了!
我看到有人建议我简单地将ProgressBar设置为具有负上边距或下边距,但这并不是一个真正的解决方案,并且在不同的手机上并不一致。
我的XML目前看起来像这样:
<FrameLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:background="@color/green">
<ProgressBar
android:id="@+id/ticket_state_progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:indeterminate="true"
style="?android:attr/indeterminateProgressStyle"/>
</FrameLayout>
并且样式:
<style name="linear_progress" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:indeterminateTint">@color/progress_bar_yellow</item>
<item name="android:backgroundTint">@color/progress_bar_yellow_background</item>
</style>
目前进度条出现在标题底部几个像素之上,尽管该空间也被进度条视图所覆盖。我希望进度条本身可以与标题底部齐平。感谢您提供的任何帮助 :)
android:layout_height="match_parent"
代替"wrap_content"。 - DarkCygnus