自定义的UIAlertView在IOS7中需要注意的问题

在IOS7之前,我们更改系统的UIAlertView,以实现自己想要的效果:

#pragma mark -- UIAlertViewDelegate

//实现代理增加网络指示器
- (void)willPresentAlertView:(UIAlertView *)alertView{
    indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    indicator.frame = CGRectMake(110, 20, 50, 50);
    
    [alertView addSubview:indicator];
    [indicator startAnimating];
    [indicator release];
}

在iOS7上不允许我们更改系统的UIAlertView,自己添加的控件将不再显示了。

解决方法:可以采用UIWindow的方式实现,网上有很多具体的做法,就不再描述了。

 
原文地址:https://www.cnblogs.com/417460188dy/p/3336384.html