gpt4 book ai didi

iphone - 自定义加载指示器(旋转器)

转载 作者:行者123 更新时间:2023-12-03 20:26:05 24 4
gpt4 key购买 nike

我想用我的自定义图像替换从服务器加载数据时出现的默认微调器。我有 16 张图像。

知道如何用自定义加载指示器替换它吗?

最佳答案

这可以使用 UIImageView 来完成(如果您愿意,您可以创建一个自定义 UIView 子类来执行此操作)。基本代码是这样的:

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.frame];

animatedImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"spinner-01.png"],
[UIImage imageNamed:@"spinner-02.png"],
[UIImage imageNamed:@"spinner-03.png"],
[UIImage imageNamed:@"spinner-04.png"],
nil];

animatedImageView.animationDuration = 1.0;
animatedImageView.animationRepeatCount = 0;

[animatedImageView startAnimating];

关于iphone - 自定义加载指示器(旋转器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5462374/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com