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.
精彩评论