How to set activity indicator for a view when Click the table cell

前端 未结 3 623
醉酒成梦
醉酒成梦 2021-01-29 12:00

I am developing one iPad application using story board.In my view controller one table is set as the left side and one more view is set as the right side.I need to set one activ

3条回答
  •  暖寄归人
    2021-01-29 13:01

    Use the delegate method didSelectRowAtIndexPath of TableView and write the following code into it

    UIActivityIndicatorView *activity = 
    [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    activity.frame = CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2, 50, 50);
    [self.view addSubview:activity];
    [activity startAnimating];
    

    Stope this when your work is done and remove it from the view

提交回复
热议问题