【发布时间】:2016-02-11 15:06:15
【问题描述】:
我一直在尝试更改进度条的颜色,我注意到它使用了强调颜色(在我的情况下是蓝色),我一直在尝试更改它,但没有运气。
我错过了什么吗?
这是我的styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="searchViewStyle">@style/AppTheme.SearchView</item>
<item name="editTextColor">@android:color/white</item>
<item name="actionBarStyle">@style/AppTheme.ActionBarStyle</item>
<item name="actionOverflowButtonStyle">@style/AppTheme.OverFlowItem</item>
<item name="colorPrimary">@color/ColorPrimary</item>
<item name="colorPrimaryDark">@color/ColorPrimaryDark</item>
<item name="colorAccent">@color/ColorPrimaryDark</item>
</style>
这是我在 layout.xml 中的元素
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="fill_parent"
style="@style/Widget.AppCompat.ProgressBar"
android:id="@+id/progressBar01"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:indeterminate="true"/>
我的活动:
public class MainActivity extends android.support.v7.app.AppCompatActivity
【问题讨论】:
-
without luck是什么意思到目前为止您尝试过什么?它如何不工作的任何结果?因为你有"colorAccent">@color/ColorPrimaryDark,颜色来自ColorPrimaryDark -
是的,那是深红色,
<color name="ColorPrimaryDark">#DD2C00</color> -
谢谢 :) 您说:在我的情况下是蓝色,所以 AccentColor 应该是
#DD2C00。但这不是蓝色的吧?
标签: android android-layout android-styles