How to display activity indicator in middle of the iphone screen?

前端 未结 15 1087
盖世英雄少女心
盖世英雄少女心 2020-12-22 22:43

When we draw the image, we want to display the activity indicator. Can anyone help us?

15条回答
  •  清酒与你
    2020-12-22 23:10

    This is the correct way:

    UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    activityIndicator.center = CGPointMake(self.view.frame.size.width / 2.0, self.view.frame.size.height / 2.0);
    [self.view addSubview: activityIndicator];
    
    [activityIndicator startAnimating];
    
    [activityIndicator release];
    

    Setup your autoresizing mask if you support rotation. Cheers!!!

提交回复
热议问题