I want to write my own style for a horizontal ProgressBar.
If you want to add a horizontal ProgressBar, it needs to reference the system style as follows:
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
I wrote my own style for him, which adds some parents, but since there is already a link to the style that gives it a horizontal shape, I need to inherit this style of the system.
I tried like this:
<style name="itemViewProgressBar" parent="@android:attr/progressBarStyleHorizontal">
<item name="android:paddingLeft">@dimen/ivProgressBarPaddingLeft</item>
<item name="android:paddingRight">@dimen/ivProgressBarPaddingRight</item>
<item name="android:paddingTop">@dimen/ivProgressBarPaddingTop</item>
<item name="android:paddingBottom">@dimen/ivProgressBarPaddingBottom</item>
</style>
And in the ProgressBar, I referenced this as follows:
<ProgressBar
android:id="@+id/progressBar1"
style="@style/itemViewProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
The xml style does not give me any errors, so the link works fine. But still, this does not affect the ProgressBar. It looks the same as I left the attribute parent(i.e. It shows a circular ProgressBar).
, , paddings ProgressBar ProgressBar, . , , .
, , ProgressBar, paddings ?