因此,出于某种原因,我刚刚添加了一个动作表,它就会出现并停在屏幕底部之上。有没有办法手动告诉这里停止?
- (void)showActionSheet:(UIButton *)standardButton{
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:nil otherButtonTitles:@"Choose From Library", @"Take Photo", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleAutomatic;
[popupQuery showInView:self];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
// Choose from library tapped
NSLog(@"Choose");
} else if (buttonIndex == 1) {
// Take a photo tapped
NSLog(@"Take");
}
}
答案 0 :(得分:1)
尝试使用self.view
代替self
。