5

How can I create a Customize Alert View in iOS with Radio Buttons on it like this one in android (what i want is in iOS).

enter image description here

I search for a while and cannot find any way to do it so I ask here.

1 Answers1

6

I would suggest you to use a modal view or try adding a subview to achieve this, DO NOT use UIAlertView to do this. I did the same iOS 7 UIDatePicker in UIAlertView customisation but it stopped working from iOS 7.

Action Sheet sample code:

 UIActionSheet *actionSheet = [[UIActionSheet alloc]
                                  initWithTitle:@"Select State"
                                  delegate:self
                                  cancelButtonTitle:@"Cancel"
                                  destructiveButtonTitle:nil
                                  otherButtonTitles:@"State 1",@"State 2",@"State 3",@"State 4",@"State 5",@"State 6", @"State 1",@"State 2",@"State 3",@"State 4",@"State 5",@"State 6",@"State 1",@"State 2",@"State 3",@"State 4",@"State 5",@"State 6", nil];

    actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
    [actionSheet showInView:self.view];
Community
  • 1
  • 1
Satheesh
  • 10,998
  • 6
  • 50
  • 93
  • Thank you for your answer. I searched about UIActionSheet, is it ok to use? –  Nov 06 '13 at 05:45
  • Yes you can easily achieve this using UIActionSheet. See the answer now. – Satheesh Nov 06 '13 at 05:47
  • Better to create custom Alert by using UIView, then U can use any where or other application as well. Actionsheet might not be satisfied your complete requirement.. – simbesi.com Nov 06 '13 at 06:48