Search code examples
iphoneiosipaduialertview

conflict in orientation while using custom alert


In my app i have created one custom alert view with one progress bar and one button , while rotate the device , custom alertview also rotate but the alert view size in automatically changed. how can i fix it? !


Solution

  • When rotating your device, on each view a property is checked, if autoresizing for a view is enabled.

    Your custom alert view, as it is certainly a subclass of UIView, has a property called autoresizingMask. Set the value to UIViewAutoresizingNone like so:

    self.view.autoresizingMask = UIViewAutoresizingNone;