How to add subview inside UIAlertView for iOS 7

来源:互联网 发布:企业淘宝 编辑:程序博客网 时间:2024/05/25 18:09

I am having an application on iTunes store which displays some UILabel and UIWebView on UIAlertView. According to session video, addSubView for UIAlertView will not work. They have talked about ContentView. But in the GM Seeds SDK, I could not find that property and there seems to be no other way.


You can really change accessoryView to customContentView in iOS7 UIAlertView

[alertView setValue:customContentView forKey:@"accessoryView"];

Try this code:

UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"TEST" message:@"subview" delegate:nil cancelButtonTitle:@"NO" otherButtonTitles:@"YES", nil];UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80, 40)];[av setValue:v forKey:@"accessoryView"];v.backgroundColor = [UIColor yellowColor];[av show];

But,to be sure that, i do't know if this will get rejected by apple.


0 0