我将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键在左边。快门在右。机器旋转的时候界面不变。这要怎么实现?
解决方案 »
- Xcode连接SVN提交或者更新代码后~内存狂飙,上升到满~
- 问个OBJECTC的语法小问题
- C#开发服务器端
- 有興趣學iPhone的,來這裡CocoaChina
- 帮忙推荐SIP服务器软件,谢谢!
- app延迟严重啊,急求好的办法
- OS下如何实现网页上调用系统短信界面发送短信的功能(需要传递端口号和短信内容)
- IOS引导页添加后,tablebar自动变高。。
- 求解: js 中 stylesheets 的 rules(cssrules) 为Null,只给了一个href
- OC中 数组的addObject: 方法在任何一个类中都有可能会被调用,如果在数组中插入了一个 nil值而导致系统崩溃,如何判断是在哪个类中调用引起的呢?
- 手动创建CALayer和动画不成功!
- Swift怎么处理PHP server端返回值
可以,相机的页面应该在一个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这个来跳转。我现在开了一个新的控制器。然后需要拍照的时候再跳到拍照的视图控制器去。可是它根本就不出来。。还有警告。。还有刚刚加了一个第三方包。也报错了。。