我将我的应用程序转换为ios6,但我得到旋转问题。 有人能帮我这方法会被调用,当我们转动装置ios6旋转问题
Q
ios6旋转问题
0
A
回答
0
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self doLayoutForOrientation:toInterfaceOrientation];
}
- (void)doLayoutForOrientation:(UIInterfaceOrientation)orientation {
if (UIInterfaceOrientationIsPortrait(orientation))
{
//set the frames here
}
else
{
//set the frames here
}
}
这些是ios 6中的新方法,您可以根据方向设置帧。希望它对你有用。
0
- (BOOL) shouldAutorotate
-(NSUInteger)supportedInterfaceOrientations
这些都是加入到iOS 6
0
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
-(void)viewWillLayoutSubviews
{
if([self interfaceOrientation] == UIInterfaceOrientationPortrait||[self interfaceOrientation] ==UIInterfaceOrientationPortraitUpsideDown)
{
//set the frames here
}
else if ([self interfaceOrientation] == UIInterfaceOrientationLandscapeLeft||[self interfaceOrientation] == UIInterfaceOrientationLandscapeRight)
{
//set the frames here
}
}
更好的去使用此,上述新功能方法将在您每次更改设备的方向时调用。
+0
嘿谢谢你,它的作品Gud @krish – Babul
0
手柄旋转这些方法
-(BOOL) shouldAutorotate
{
return NO;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
如果某些视图中旋转,你不想等的UIImagePickerController只是做一个子类,并覆盖第一种方法。
相关问题
- 1. IOS6旋转问题
- 2. UITabBarController和旋转iOS6
- 3. PHP iphone/iOS6的上传旋转的问题:什么是保存旋转图像
- 4. 在iOS6下旋转多个xibs的问题
- 5. ios6从横向到纵向模式的旋转问题
- 6. 旋转问题
- 7. 旋转问题
- 8. ViewController不在iOS6上旋转
- 9. MKMapView旋转iOS6缩放
- 10. iOS6设备旋转限制
- 11. 在iOS6中旋转破裂
- 12. ECSlidingViewController,禁用旋转iOS6
- 13. iOS6错误旋转Cocos2D
- 14. OpenGL旋转问题
- 15. OpenGL旋转问题
- 16. Java旋转问题
- 17. UITableView旋转问题
- 18. 旋转问题Android
- 19. UIViewController旋转问题
- 20. Android旋转问题
- 21. CSS3旋转问题
- 22. c#旋转问题
- 23. SearchBar旋转问题
- 24. 旋转UIImage问题
- 25. UIScrollView旋转问题
- 26. iPhone旋转问题
- 27. UIView旋转问题
- 28. UiViewController旋转问题
- 29. MPMoviePlayerViewController旋转问题
- 30. 轴旋转问题
我已经使用这个,但它不是每次都调用 –
你是否在使用任何第三方UI框架如three20或其他? –
不,我只使用sdwebimage –