Pregunta

I would like to determine width of UIAlertView before I show it and after I setup it. I need that to put UIImageView into it and adjust its width to width of UIAlertView. Is there any way to do that?

¿Fue útil?

Solución

It is not a very good idea to try modifying the UIAlertView's height/width or add a UIImageView to it as this might result in your app getting rejected by the App Store. However, ios-custom-alertview is a good alternative.

A sample code would be:

CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];
[alertView setContainerView:yourSubView];
[alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Close", nil]];
[alertView show];

Otros consejos

You can use this, ios-custom-alertview https://github.com/wimagguc/ios-custom-alertview

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top