Morozov
Morozov

Reputation: 5250

Size of Progress Bar doesn't change

I want to place my ProgressBar in my LinearLayout:

<style name="MyProgressBar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
            <item name="android:progressBackgroundTint">#69f0ae</item>
            <item name="android:progressTint">#b71c1c</item>
            <item name="android:layout_width">match_parent</item>
            <item name="android:layout_height">@dimen/dp_2</item>
        </style>

but this line of code doesn't work correctly:

<item name="android:layout_width">match_parent</item>

Size does not change.

But if i write smth like this my size is changing:

<item name="android:minWidth">200dp</item>

Upvotes: 0

Views: 634

Answers (1)

Richard Dapice
Richard Dapice

Reputation: 885

Try creating a style then applying it your progress bar in layout should look like this.

I don't think you need to set your layout width and height in style.

 <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal" , <- Replace with custom style here.
        android:layout_width="match_parent"
        android:layout_height="@dimen/progressBarHeight"
        android:indeterminate="true" />

Upvotes: 1

Related Questions