android - 如何更改每次旋转的滑动刷新布局颜色?

标签 android

有没有人注意到 gmail 中的 SwipeRefreshLayout。它会在一次加载迭代中为每次旋转改变颜色。有谁知道如何实现它?

最佳答案

documentation对于 SwipeRefreshLayout详情 setColorSchemeResources()setColorSchemeColors()可用于设置 SwipeRefreshLayout 的配色方案的方法

docs状态:

Set the color resources used in the progress animation from color resources. The first color will also be the color of the bar that grows in response to a user swipe gesture.

您应该注意 setColorSchemeColors()应与特定颜色值和 setColorSchemeResources() 一起使用当您打算使用对颜色的资源引用时应使用(例如 R.color.red )。

另请注意setColorScheme() ,完成此操作的旧方法现在已弃用

关于android - 如何更改每次旋转的滑动刷新布局颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32460829/

相关文章:

android - 将 C++ 添加到 Android Studio 2.2

java - LibGDX 输入仅运行我的循环一次,并且在单击鼠标时不会连续运行

Java浮点指针

java - Android GridLayout 中将图像拉伸(stretch)至屏幕大小

Android侧边导航菜单: how to include the actionbar in the slided view?

java - 当相应设置 target 和 min sdk 时,为什么 LayoutParams.MATCH_PARENT 没有运行时异常?

android - 谷歌素材库和设计支持库的区别

java - 为什么主构造函数主体在字段初始化之前执行?

Java/Android : generic method - apply same functionality to different objects

Android Google Maps GeoJson,如何为整个 map 着色一种颜色