iPad - iPhone 大 UIActivityIndi​​catorView

发布于 2024-09-13 17:26:39 字数 65 浏览 3 评论 0原文

我需要制作一个大型旋转器(灰色风格,大约80x80px),但它看起来质量很低。 有没有办法提高其质量或替换动画图像?

I need to make a large spinner (with grey style, about 80x80px) but it looks low quality.
Is there a way to make it high quality or to replace the animated image?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

笛声青案梦长安 2024-09-20 17:26:39

实际上,您可以将 UIActivityIndi​​catorView 的指示器样式设置为 Large White,然后在代码中执行以下操作:

// Objective-C
[myActivityView setColor:[UIColor grayColor]];
// Swift 4.0
myActivityView.color = .grayColor

Actually, you can set the indicator style of your UIActivityIndicatorView to Large White, and then in code do this:

// Objective-C
[myActivityView setColor:[UIColor grayColor]];
// Swift 4.0
myActivityView.color = .grayColor
我的黑色迷你裙 2024-09-20 17:26:39

斯威夫特2.0解决方案

myActivityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge
myActivityView.color = UIColor.grayColor()

Swift 2.0 Solution

myActivityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge
myActivityView.color = UIColor.grayColor()
蓝海 2024-09-20 17:26:39

使用 UIActivityIndi​​catorView 无法完成此操作。但是,您可以使用 UIImageView 和一些简单的动画编写自己的 UIView 子类来为您完成此操作。

It can't be done using UIActivityIndicatorView. you can however write your own subclass of UIView using an UIImageView and some simple animation to do this for you.

℉絮湮 2024-09-20 17:26:39

斯威夫特3

extension UIActivityIndicatorView {
    func makeLargeGray() {
        activityIndicatorViewStyle = .whiteLarge
        color = .gray
    }
}

Swift 3

extension UIActivityIndicatorView {
    func makeLargeGray() {
        activityIndicatorViewStyle = .whiteLarge
        color = .gray
    }
}
天邊彩虹 2024-09-20 17:26:39

你可以尝试这样的事情:

activityIndicator.transform = CGAffineTransform(scaleX: 1.3, y: 1.3)

但是,如果你把它做得足够大,你将能够看到像素......

You could try something like:

activityIndicator.transform = CGAffineTransform(scaleX: 1.3, y: 1.3)

However, if you make it big enough, you'll be able to see the pixels...

绿萝 2024-09-20 17:26:39

斯威夫特 4.2

extension UIActivityIndicatorView {
    func makeLargeGray() {
        style = .whiteLarge
        color = .gray
    }
}

Swift 4.2

extension UIActivityIndicatorView {
    func makeLargeGray() {
        style = .whiteLarge
        color = .gray
    }
}
聽兲甴掵 2024-09-20 17:26:39

您可以开始使用的一个有用项目是 MBProgressHUD

A useful project that you can start off with is MBProgressHUD.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文