我有一种方法称为-showMoreTools:它是:iPad的UIActionSheet表示多次
- (IBAction) showMoreTools:(id)sender {
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:@"Close" otherButtonTitles:@"Add Bookmark", @"Add to Home Screen", @"Print", @"Share", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleDefault;
popupQuery.dismiss
[popupQuery showFromBarButtonItem:moreTools animated:YES];
[popupQuery release];
}
当用户敲击
UIBarButtonItem
它显示
UIActionSheet
,但随后,如果用户想要关闭
UIActionSheet
而不胶带关闭按钮,(录音的
UIBarButtonItem
,然后它会显示
UIActionSheet
在第一
UIActionSheet
它可以实现某种程度上录音另一个时间UIBarButtonItem
关闭UIActionSheet
谢谢你这么多? - 我在iOS的编程新手!
解决方案适用于我,当我遇到同样的问题时,谢谢。我想知道为什么苹果没有提到这一点,因为他们明确地做到了这一点,当它“将拥有按钮的工具栏添加到popover的passthrough视图列表” – Bryan 2011-12-21 20:32:42
另外,我认为你应该已经设置actionSheet_为null在actionSheet clickedButtonAtIndex: – Bryan 2011-12-21 20:40:57
你不需要。如果您选择一个按钮,则调用clickedButtonAtIndex,然后调用didDismissWithButtonIndex。把这个= nil只需要那个方法。我只是在调试器中检查了它。 – christophercotton 2011-12-21 20:48:18