xcode UIRefreshControl 改变 UIActivityIndi​​catorView 的颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14642484/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:41:19  来源:igfitidea点击:

UIRefreshControl change color of UIActivityIndicatorView

objective-cxcodecolorsuiactivityindicatorviewuirefreshcontrol

提问by user1053839

There is any way to change the color of the "UIActivityIndicatorView" of the UIRefreshControl??

有什么办法可以改变UIRefreshControl的“UIActivityIndi​​catorView”的颜色??

I didn't find anything!

我什么都没找到!

Thanks!!

谢谢!!

UIRefreshControl

界面刷新控件

回答by subharb

You can do it by setting the Tint Colorof the UIRefreshControl, something like this:

您可以通过设置做到这一点Tint ColorUIRefreshControl,是这样的:

Objective C[refreshControl setTintColor:[UIColor blackColor]];

目标C[refreshControl setTintColor:[UIColor blackColor]];

SwiftrefreshControl.tintColor = .black

迅速refreshControl.tintColor = .black

This will also change the arrow that expands when you slide.

这也将更改滑动时展开的箭头。

回答by Rosalie W

As the previous answer is outdated, I thought that I would just modify it to Swift 4 and share the solution (credit goes to @subharb).

由于之前的答案已过时,我认为我只需将其修改为 Swift 4 并分享解决方案(归功于 @subharb)。

refreshControl.tintColor = UIColor.white

This line of code will change the color of the UIActivityIndicatorView to whatever color you want it to be :)

这行代码会将 UIActivityIndi​​catorView 的颜色更改为您想要的任何颜色:)