0
votes

I am developing one application. In that application i want to present a action sheet with options.
I written the following code for the action sheet requirement.

UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:AALocalizedString(@"Capture Document", nil),AALocalizedString(@"Select Document", nil) ,AALocalizedString(@"Capture Photo", nil),AALocalizedString(@"Select Photo", nil),nil];      
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view];
actionSheet=nil;

only cancel button is displayed It is working fine in iphone and ipad devices i.e, iphone5,iphone5c,iphone5s,iphone4,iphone4s,ipod touch, ipad etc.
But it is not working in iPad Mini. only cancel button is displayed.

2
Popover is available for iPad mini. - Sviatoslav Yakymiv
My application is not a universal application. I am trying to present a popover but it give me an error like popover is only available for ipad. - MobileDev
iPad mini and iPad are exactly the same device. Anything that is available for iPad is also available for iPad Mini. - Fogmeister
iPad and iPad mini is as the only difference of screen size. - Kumar KL
working fine in ipad devices only problem with the ipad mini. - MobileDev

2 Answers

1
votes

You used AALocalizedString method when setting the other button titles of Action Sheet. Ensure that the method will give the string or not. If it is not giving any string then action sheet is not displaying other buttons rather than cancel button. Or once try the below code.

    UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Capture Document",@"Select Document" ,@"Capture Photo",@"Select Photo",nil];      
    actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
    [actionSheet showInView:self.view];
    actionSheet=nil;
0
votes

May be help you,

UIAlertController *alertCV = [UIAlertController alertControllerWithTitle:@"Alert Title" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
        UIAlertAction *alertActn = [UIAlertAction actionWithTitle:@"Test1" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
            [alertCV dismissViewControllerAnimated:YES completion:nil];
        }];
        UIAlertAction *alertActn1 = [UIAlertAction actionWithTitle:@"Test2" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
            [alertCV dismissViewControllerAnimated:YES completion:nil];
        }];
        [alertCV addAction:alertActn];
        [alertCV addAction:alertActn1];
        [self presentViewController:alertCV animated:YES completion:nil];