有没有人注意到 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/