开发者

Modal uiactionsheet ipad that cannot be dismissed

How do I create an UIActionsheet on the iPad without having it dismissed by tapping the area aroun开发者_运维知识库d the action sheet? This is default on the iPhone, any luck on the iPad


I faced the same problem and I came up with a workaround more than a solution.

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    NSLog(@"%d",buttonIndex);
    switch (buttonIndex) {
        case -1:
            [self presentOptions];
    //.... more cases here
    }
}

When the user taps outside the UIActionSheet you get a -1 as buttonIndex. In that case I presented the UIActionSheet again (by calling my method presentOptions that just presents the action). From the users perspective you can see a tiny blink un the UIActionSheet: hardly noticeable. Not a perfect solution but and acceptable workaround I'd say.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜