开发者

UIActionSheet and UIAlertView focus on iPad

I have some troubles with UIActionSheet and UIAlertView on iPad in fact, i use an alertView as a pop up with textfields and buttons to enter a date, when i click on the button the UI开发者_开发知识库ActionSheet who contains my UIDatePicker is supposed to show, it shows but i don't have focus to pick a date the focus is still on the alertview and the ActionSheet is in the background (but on iphone there is no problem it works fine)

is there some code to add for the iPad?

Thanks for your help


In the clickedButtonAtIndex method of your AlertView explicitly dismiss the alertView and show your ActionSheet.

using; - (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated and present the action sheet

e.g

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
[alertView dismissWithClickedButtonIndex:0 animated:NO];
if(buttonindex==1{
[self showActionSheet]
}
}

NB for Iphone you may not need to dismiss the alertView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜