引っ越しました。

このブログは引っ越しました。
今後は引越し先で更新を続けます。
新しいブログではソースコードにシンタックスカラーを付けているので見やすくなっていると思います。

こちらは数ヶ月後に削除しますのでよろしくお願いします。

2010年6月28日月曜日

ModalViewにNavigationControllerを追加する方法

ブログ移行しました。
新しいブログでのこの記事は ModalViewにNavigationControllerを追加する方法 こちらです。
シンタックスカラーなど導入しているのでソースコードが見やすくなっているはずなので是非っ。


通常のモーダルは
ModalView* dialog = [[[ModalView alloc] init] autorelease];
dialog.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:dialog animated:YES];
でモーダルに推移する。
このモーダルにナビゲーションバーを追加表示する。
方法は超簡単。
ModalView* dialog = [[[ModalView alloc] init] autorelease];
dialog.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
UINavigationController *NavigationController =
[[UINavigationController alloc] initWithRootViewController:dialog];
[self presentModalViewController:NavigationController animated:YES];
以上でおk。
あとはバーのカスタマイズでボタンを色々追加すると良いよ。

っていうかUINavigationControllerにモーダルビューだろうとラベルビューだろうと突っ込んでおけばとりあえずナビゲーションバーは表示されるはず。
…はず。

0 件のコメント:

コメントを投稿