2

我有根据用户偏好在我的应用程序中动态生成的颜色。我在 chrisbane 的 ActionBar-PullToRefresh 库中有效地使用了这些颜色,但由于该库不再被开发,我正试图转移到 SwipeRefreshLayout。但是,SwipeRefreshLayout 似乎只采用颜色资源 ID,而不是直接表示颜色的整数,因此我找不到任何方法来为进度条着色。我在 SwipeRefreshLayout 中缺少什么可以让我做我需要做的事情吗?

4

1 回答 1

4

不确定 v19 支持库,但 v20 有以下方法:

public void setColorSchemeResources(int colorRes1, int colorRes2, int colorRes3, int colorRes4)

它允许您按资源设置颜色。但也存在以下方法,它采用颜色:

public void setColorSchemeColors(int color1, int color2, int color3, int color4) 

第二个是你的答案

于 2014-07-01T12:09:24.740 回答