0

私が見たアプリでは、情報ライト ボタンはすべてナビゲーション バーにあり、タッチすると、新しいビューへの遷移が水平方向に反転します。ナビゲーション バーに情報ライト ボタンがなく、タッチしたときにプッシュ アニメーションを使用してユーザーを新しいビューに転送するアプリケーションを作成しても問題ありませんか? そうでない場合は、モーダルを選択してフリップしてビューに接続すると、押されても何も起こらないため、水平フリップのコーディング方法を誰かに教えてもらえますか (ただし、モーダルではなくプッシュを選択すると機能します。ありがとう

4

1 に答える 1

0

やりたいことは何でもできます。どの種類のボタンがどの種類のビューの変更を引き起こすべきかについてのガイドラインはありません。

以下に、ビュー コントローラーを変更する方法の例をいくつか示します。

//if you are using xibs use this line
UIViewController *controller = [[UIViewController alloc] initWithNibName:@"myXib" bundle:[NSBundle mainBundle]];
//if you are using storyboards use this line
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"myViewControllersID"];

[controller setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
//this sets the modal transition style

//to present the controller modally use this
[self presentViewController:controller animated:YES completion:nil];
//or if you are pushing to this controller using a navigation controller use this
[self.navigationController pushViewController:controller animated:YES];
于 2012-09-08T00:29:05.937 に答える