我将info.plist里面可旋转的方向给成3个。
然后再ViewController里面添加了这个方法。相册可以进去了。而且View也一直保持home键在左的方向。
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
但是我进入拍照功能的时候。快门键永远在右边。而且拍照界面会跟着机器旋转而旋转。只有home键在左边的时候界面内容才是正确方向。比如把机器home键放到底部的时候。快门键还是在右边。home键放到右边的时候,快门虽然在右。可是镜像旋转了180度。
我想把界面控制在home键在左边。快门在右。机器旋转的时候界面不变。这要怎么实现?
然后再ViewController里面添加了这个方法。相册可以进去了。而且View也一直保持home键在左的方向。
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
但是我进入拍照功能的时候。快门键永远在右边。而且拍照界面会跟着机器旋转而旋转。只有home键在左边的时候界面内容才是正确方向。比如把机器home键放到底部的时候。快门键还是在右边。home键放到右边的时候,快门虽然在右。可是镜像旋转了180度。
我想把界面控制在home键在左边。快门在右。机器旋转的时候界面不变。这要怎么实现?
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
需要的,如果NavigationController支持多个方向也是不行的,总而言之,是需要写在最外层的Controller里,你可以类似于这样:- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后交由你自己的VC去处理
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
需要的,如果NavigationController支持多个方向也是不行的,总而言之,是需要写在最外层的Controller里,你可以类似于这样:- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后交由你自己的VC去处理
我写到我的VC里面之后全部报错了。
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
需要的,如果NavigationController支持多个方向也是不行的,总而言之,是需要写在最外层的Controller里,你可以类似于这样:- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后交由你自己的VC去处理
最开始的时候就是加了这一句
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
才能够固定我之前的View方向。
否则是可以旋转的。
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
需要的,如果NavigationController支持多个方向也是不行的,总而言之,是需要写在最外层的Controller里,你可以类似于这样:- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后交由你自己的VC去处理
最开始的时候就是加了这一句
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
才能够固定我之前的View方向。
否则是可以旋转的。
恩,但是系统相机的页面可没有这么写,你把那三个方法写在UINavigation的类别里,可以先把这个类别放在AppDelegate里测试一下
可以,相机的页面应该在一个NavigationController里,你写一个NavgationController的类别,在里面重写shouldAutorotate、supportedInterfaceOrientations、preferredInterfaceOrientationForPresentation这三个方法
我已经自定义一个裁剪页了。还可以重写这三个方法么。。
需要的,如果NavigationController支持多个方向也是不行的,总而言之,是需要写在最外层的Controller里,你可以类似于这样:- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后交由你自己的VC去处理
最开始的时候就是加了这一句
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
才能够固定我之前的View方向。
否则是可以旋转的。
恩,但是系统相机的页面可没有这么写,你把那三个方法写在UINavigation的类别里,可以先把这个类别放在AppDelegate里测试一下
我没有用UINavigation这个来跳转。我现在开了一个新的控制器。然后需要拍照的时候再跳到拍照的视图控制器去。可是它根本就不出来。。还有警告。。还有刚刚加了一个第三方包。也报错了。。