私のアプリケーションにはポートレート駆動の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でオーバーレイ表示を回転する
- 2. iPhoneアプリケーションでMKMapViewを回転する
- 3. Iphone IplImageをUIImageに変換して戻すと回転する
- 4. iPhoneビュー回転/スイングアニメーション
- 5. iPhone - 画面回転?
- 6. iPhoneで自動回転
- 7. iPhone 4の回転数をカウントする
- 8. iPhoneシミュレータの画面回転
- 9. 変換:回転(-90deg)iPhoneで動作しません
- 10. IE11で回転を変換
- 11. Pythonで行列のブロックを転置/回転する
- 12. ViewControllerを回転させるとUIViewオブジェクトが移動する
- 13. ジョイント回転位置
- 14. リストの位置を回転する
- 15. iPhone Cocos2D - スプライトを回転させる指
- 16. ViewControllerを置き換えます
- 17. 回転スプライトの位置
- 18. CSS3回転変換
- 19. CSS「変換:回転()」:
- 20. 回転div要素を配置する
- 21. ウィンドウの回転はViewControllerではありません
- 22. iphoneで画像を置換する
- 23. iPhoneでmpmovieプレーヤーオブジェクトの回転を処理する方法は?
- 24. iPhoneのビューの回転が正しく
- 25. iPhoneの回転後にUIScrollViewのcontentOffset
- 26. テーブルを時計回りに90度回転(転置しない)
- 27. シーンキットの変換と回転
- 28. Qt3Dの回転と変換
- 29. 回転後にバッファを変換する
- 30. iphoneの回転を検出するときに検出する
だからあなたは新しいのViewControllerをロードしたいですか? – SNR