Sunday, April 20, 2014

ProgressBar not help rookie height on a line


android: id = "@ + id / down_pb"
style = "android:? attr / progressBarStyleHorizontal"
android: layout_width = "100dip"
android: layout_height = "8sp"
android: max = "100"
android: progress = "50"
android: minHeight = "10dip"
android: maxHeight = "10dip" />

How to change the height has been constant, that is, a line width, what progress can be changed
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
4.0 sounds like a line to. .
Reply:
I used 3.0
Reply:
See online examples are style = "android:? Attr / progressBarStyleHorizontal" The default height

Or via android: layout_height = "8sp" set the height directly, can I set up a useless

Reply:
I remember that time is 2.0 bar yellow, blue gray later became a
Yellow when very wide, turned blue after a line like that. . Really did not notice how the height.
Reply:
The first is now described in android4.1 system, ProgressBar becomes a line, such as in the previous 2.3 system, set the ProgressBar property is:
Code

`` `android: id = "@ + id/progressBar1" style = "android:? attr / progressBarStyleHorizontal"
android: layout_width = "240dp"
android: layout_height = "40dp"
android: layout_marginLeft = "20dp"
android: layout_marginTop = "20dp"
android: indeterminate = "false"
android: max = "100" />

Above us by setting its width, height and the distance to the left and top, which is in the 2.3 system is entirely achievable. But in the 4.1 system, if only so that the result is just a thin line only, so you want to set it high 4.1 system, methods need to re-set the style attribute in style.xml file;

The first step follows Edit:

`` `Style
Code

`` `



Step two: refer to this style can be, style = "@ style / tallerBarStyle", as follows:

`` `Java
Code

`` `android: id = "@ + id/progressBar1"
_ Style = "@ style / tallerBarStyle" _
android: layout_width = "240dp"
android: layout_height = "40dp"
android: layout_marginLeft = "20dp"
android: layout_marginTop = "20dp"
android: indeterminate = "false"
android: max = "100"
/>



The modified progress bar will become what we want it.

Stressed:
ProgressBar 4.1 system default is a line, if the style attribute to write style = "android:? Attr / progressBarStyleHorizontal", even if set high, it can not change the status of a line.

No comments:

Post a Comment