iPhone UIImagePicker相机在横向方向
-
21-09-2019 - |
题
有没有设置UIImagePicker
为横向什么好办法?我试图像以下setStatusBarOrientation
之后调用presentModalViewController
,
[self presentModalViewController:picker animated:YES];
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ];
然而,视频持续时间视图(00:00)上右角不旋转作为取向改变。
解决方案
不幸的是,根据本文档,图像选择器只支持纵向模式。
其他提示
苹果不支持相机视图景观。如果您想要的任何显示为定制然后在其上添加重叠视图和变换观点看作为横向视图。 @Note:-overlay也添加作为画像这就是为什么需要转化
。我能够用下面的代码来创建景观相机视图:
[self.view insertSubview:self.imagePicker.view atIndex:0];
self.imagePicker.view.transform =
CGAffineTransformScale (
CGAffineTransformTranslate(
CGAffineTransformMakeRotation(M_PI/2), -90, -15),
1.2,1.2)
;
请注意,我直接添加imagePicker的视图到当前视图,而不是调用它作为模态。
self.imagePicker.view.transform
似乎为应对预计所有CGAffineTransform
函数调用,虽然我不能到苹果是否赞同这种方法的发言。
不隶属于 StackOverflow