我將我的應用程序轉換爲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 –