开发者

Hide UIActionSheet on iPad

I just got a mail from apple that my iPad app was rejected because my 'app contains popover elements that didn't point to the element that revealed them and more than one popover element visible onscreen at a time'.

The problem is that I call an actionsheet which is still visible when I switch from one view to another and that there can be called to actionsh开发者_开发技巧eets at a time. Now I ask myself how I can hide an actionsheet on a view change or when another actionsheet is opend.


I solved the issue with the sheet showing multiple times when you tap the same button by checking isVisible, as in the following:

- (IBAction) btnFoo: (id) sender
{
    if ([self.sheet isVisible]) {
        [self.sheet dismissWithClickedButtonIndex:self.sheet.cancelButtonIndex animated:YES];
        return;
    }

    [self.sheet showFromBarButtonItem:sender animated:YES];
}

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜