自定义加载指示器(微调)

问题描述:

我想用我的自定义图像替换从服务器加载数据时引入的默认微调器。我有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];