如何为每次旋转更改“刷卡刷新"布局的颜色? [英] How can you change a Swipe refresh layout's color for each rotation?

查看:70
本文介绍了如何为每次旋转更改“刷卡刷新"布局的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都注意到gmail中的 SwipeRefreshLayout .它可以在单个负载迭代中为每个旋转更改颜色.有谁知道如何实现它?

Has anyone noticed the SwipeRefreshLayout in gmail. It changes color for every rotation in a single load iteration. Does anyone have any idea how to achieve it?

推荐答案

文档用于 SwipeRefreshLayout 详细说明了 setColorSchemeResources() setColorSchemeColors()方法,可用于设置的配色方案SwipeRefreshLayout

The documentation for SwipeRefreshLayout details the setColorSchemeResources() and setColorSchemeColors() methods that can be used to set the color scheme of your SwipeRefreshLayout

文档状态:

从颜色资源设置进度动画中使用的颜色资源.第一种颜色还将是响应用户滑动手势而增加的条形颜色.

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()应该与特定的颜色值一起使用).code> R.color.red ).

You should note that setColorSchemeColors() should be used with specific colour values and setColorSchemeResources() should be used when you intend to use resource references to colours (e.g. R.color.red).

请注意,现在已经不赞成使用 setColorScheme()(完成此操作的旧方法).

Please also note that setColorScheme(), the old way of completing this, is now deprecated.

这篇关于如何为每次旋转更改“刷卡刷新"布局的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆