【问题标题】:Set progress bar color in actionbar sherlock在 actionbar sherlock 中设置进度条颜色
【发布时间】:2012-10-10 09:03:35
【问题描述】:
【问题讨论】:
标签:
android
actionbarsherlock
android-progressbar
【解决方案1】:
回答我自己的问题。
我没有使用操作栏进度,而是在我的布局文件中添加了一个 progressbar 元素。然后将xml 文件设置为progressdrawable 到progress bar 并使用所需的颜色。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar android:id="@+id/progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:max="100"
android:progress="0"
android:secondaryProgress="0"
android:visibility="gone"/>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
可绘制的
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:angle="270"
android:centerColor="@color/progresscolor"
android:centerY="0.75"
android:endColor="@color/progresscolor"
android:startColor="@color/progresscolor" />
</shape>
</clip>
</item>