【发布时间】:2012-11-08 11:02:05
【问题描述】:
我正在使用UIImagePickerviewController 通过以下附加代码打开照片库...在调用位行代码之后。应用程序崩溃了...它在ios5 中运行良好
UIImagePickerController* content = [[UIImagePickerController alloc] init];
content.delegate = self;
content.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:content animated:YES];
[content release];
这段代码有什么问题吗?
【问题讨论】:
-
我前几天也遇到了这个问题,让我看看我是怎么解决的。
-
我认为它与自动布局有关。您是否在放置 uiimagepicker 的视图上启用了自动布局?
-
哦,ios6 中不推荐使用 shouldAutoRotateToInterfaceOrientation:改用supportedInterfaceOrientations 和preferredInterfaceOrientationForPresentation 方法。
-
我已按照您给出的程序进行操作,但什么都不会发生,我的代码在这里而不是使用 shouldAutorotateToInterfaceOrientation:-(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeRight; }
标签: ios uinavigationcontroller uiinterfaceorientation