문제

I've been looking through the documentation for ProgressBar class and found these attributes:

  • android:progressBarStyle
  • android:progressBarStyleHorizontal
  • android:progressBarStyleLarge
  • android:progressBarStyleSmall

These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes.

Documentation doesn't say anything helpful, searched the Web, found nothing.

도움이 되었습니까?

해결책

The four attributes that you mention can be applied to a ProgressBar's style like so:

style="?android:attr/progressBarStyleHorizontal"

The style constant android:progressBarStyleHorizontal is your typical incremental progress bar:

alt text

While the other three are varying sizes of the same circular progress bar:

style="?android:attr/progressBarStyleSmall"

alt text

style="?android:attr/progressBarStyle"

alt text

style="?android:attr/progressBarStyleLarge"

alt text

Update:

According to adamp's comments:

These are attributes of the theme that point at themed styles you can use for progress indicators...They are not attributes for ProgressBar itself.

다른 팁

In case if someone is looking for full block of code

<ProgressBar
android:id="@+id/ProgressBar2"
style="?android:attr/progressBarStyleLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top