私のアプリケーションにはポートレート駆動のGUIしかありませんが、回転する必要のあるセクションはあります。 デバイスが回転しているときに、現在のView(Controller?)を閉じて、まったく別のView(Controller)に置き換えたいですか? どうすればいいですか?コード例?iPhoneの回転でViewControllerを置換する
0
A
答えて
2
あなたは、単に.xibファイル内の同じのUIViewControllerで2つの異なる見解を持っており、必要なときにそれらを切り替えることができます。
のは、あなたがのUIViewControllerで2つのビューがあるとしましょう:
- ViewPortrait
- ViewLandscape
-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
switch (toInterfaceOrientation)
{
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
self.view = self.ViewPortrait;
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
self.view = self.ViewLandscape;
break;
}
}
0
- (void)didRotate
{
//Create your new view controller here if it doesn't exist.
//Push or present the view controller
}
関連する問題
- 1. iPhoneアプリケーションでMKMapViewを回転する
- 2. iphoneでオーバーレイ表示を回転する
- 3. Iphone IplImageをUIImageに変換して戻すと回転する
- 4. iPhoneで自動回転
- 5. iPhoneビュー回転/スイングアニメーション
- 6. iPhone - 画面回転?
- 7. IE11で回転を変換
- 8. iPhone 4の回転数をカウントする
- 9. ViewControllerを回転させるとUIViewオブジェクトが移動する
- 10. ジョイント回転位置
- 11. Pythonで行列のブロックを転置/回転する
- 12. iPhoneシミュレータの画面回転
- 13. 回転スプライトの位置
- 14. CSS「変換:回転()」:
- 15. CSS3回転変換
- 16. 回転div要素を配置する
- 17. ウィンドウの回転はViewControllerではありません
- 18. シーンキットの変換と回転
- 19. iPhone Cocos2D - スプライトを回転させる指
- 20. オイラーZXZ回転から固定軸XYZ回転への変換
- 21. css回転時のチャレンジ(変換:回転)ブロック幅自動
- 22. XNA 2D回転スプライト(回転式着陸装置)
- 23. 回転イメージ(元の位置に戻す)
- 24. TabbarControllerのViewControllerをNavigationBarで置き換えます。
- 25. iphoneで画像を置換する
- 26. UIViewController内のルートViewControllerは回転しません
- 27. iPhoneでmpmovieプレーヤーオブジェクトの回転を処理する方法は?
- 28. iPhoneの回転後にUIScrollViewのcontentOffset
- 29. iPhoneのビューの回転が正しく
- 30. ブートストラップの回転台の位置
だからあなたは新しいのViewControllerをロードしたいですか? – SNR