【发布时间】:2026-02-22 06:30:02
【问题描述】:
我有一个用于 iPad 的UIActionSheet,它有三个选项:
- 取消
- 相机
- 图片库
当我触摸“照片库”选项时,我收到了崩溃和一条消息
UIStatusBarStyleBlackTranslucent 在此设备上不可用。
我读了this post,但没弄明白。
有人可以帮助我吗?
更新:
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{
imgController = [[UIImagePickerController alloc] init];
imgController.allowsEditing = YES;
imgController.sourceType = UIImagePickerControllerSourceTypeCamera;
imgController.delegate=self;
[self presentModalViewController:imgController animated:YES];
}
else if (buttonIndex == 1)
{
imgController = [[UIImagePickerController alloc] init];
imgController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgController.delegate=self;
[self presentModalViewController:imgController animated:YES];
}
}
我在最后一行遇到崩溃,即[self presentModalViewController:imgController animated:YES];
【问题讨论】:
-
对不起。错过了。现在编辑。请检查。
标签: ios cocoa-touch ipad ios5 uistatusbar