Frage

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?

War es hilfreich?

Lösung

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];

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top