How to add a Navigation Controller with Interface Builder?

1. Step: Create a new UIViewController:
- Xcode -> New File... -> Cocoa Touch Class -> UIViewController
- Имя: MyViewController

2. Шаг: Перетащите «Контроллер навигации» (UINavigationController) из библиотеки в MyViewController.xib

alt text

3. Шаг: Я уверен, мне нужно что-то сделать, чтобы правильно подключить контроллер навигации, не так ли?

4.Шаг: Попытайтесь запустить новый контроллер представления в виде модального диалога:

MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
NSLog(@"navContr: %@", myViewController.navigationController);
[self.navigationController presentModalViewController: myViewController animated:YES]; 

Результат: «navContr: nil»

5.Шаг: Вы можете увидеть новое модальное представление (MyViewController), но нет NavigationController и UINavigationBar.

Большое спасибо за вашу помощь!


ОБНОВЛЕНИЕ 1:

6. Шаг: Я установил новый UIViewController (ViewNavi2) как «Контроллер корневого представления»:
alt text

7. Шаг: SUBPIXEL_TEXT_FLAG ...

There are a few Paint constant in Android about which I couldn't find much info. Could anyone help me with a bit of explanation about those flags:

  • LINEAR_TEXT_FLAG
  • SUBPIXEL_TEXT_FLAG
  • FILTER_BITMAP_FLAG

Is 'subpixel' mode something close to ClearType or is it something altogether different?

5
задан Toto 4 January 2014 в 15:45
поделиться