-1

I used code below to add UIActivityView on UIAlertView

UIAlertView * messageBox = [[UIAlertView alloc] initWithTitle: @"Connecting to App Store..."
                                                      message: @"\n\n\n"
                                                     delegate: nil
                                            cancelButtonTitle: @"Cancel"
                                            otherButtonTitles: nil];



UIActivityIndicatorView *aActivity=[[UIActivityIndicatorView alloc]   initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

[messageBox addSubview:aActivity];
[aActivity setHidden:false];
[aActivity startAnimating];
[messageBox show];

it works well on ios 5,6 but on ios7 UIActivityIndicatorView does not display. I changed UIActivityIndicatorViewStyleWhiteLarge to UIActivityIndicatorViewStyleGray

UIActivityIndicatorViewWhite

None works

Your comments are welcome

Prince Agrawal
  • 3,619
  • 3
  • 26
  • 41
arachide
  • 8,006
  • 18
  • 71
  • 134
  • possible duplicate of [UIActivityIndicatorView not displaying in UIAlertView - iOS7](http://stackoverflow.com/questions/18981040/uiactivityindicatorview-not-displaying-in-uialertview-ios7) – rmaddy Jan 15 '14 at 17:13
  • Please search or at least look at the related questions before posting your question. – rmaddy Jan 15 '14 at 17:13
  • From iOS 7 apple restrict the user to add subview to alertview to maintain the standard of it's UI. – CoolMonster Jan 15 '14 at 17:14

1 Answers1

2

You cannot modify an alert view like you used to. The internal behavior has changed, and this is no longer possible the way you did. You will either have to roll your own implementation of alert view, or take an open source implementation, such as CXAlertView.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195