I want to show UINavigationController on top of a UITextView. However it is not showing the navigation controller. Only the UITextView is visible.
This is how I am trying to show it:
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
[myButton addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
myButton.frame = CGRectMake(0, 0, 50, 10);
[myButton setTitle:@"Done" forState:UIControlStateNormal];
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithCustomView:myButton];
[[self navigationItem] setLeftBarButtonItem:button animated:YES];
[button release];
self.title = @"Info";
self.textView = [[[UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 416)]autorelease];
self.textView.textColor = [UIColor whiteColor];
self.textView.font = [UIFont fontWithName:@"Georgia-BoldItalic" size:14];
self.textView.backgroundColor = [UIColor brownColor];
self.textView.layer.borderWidth = 1;
self.textView.layer.borderColor = [[UIColor whiteColor] CGColor];
self.textView.layer.cornerRadius = 1;
self.textView.textAlignment = UITextAlignmentCenter;
self.textView.text = @"\nThis is UITextView\nThis is UITextView\nThis is UITextView\nThis is UITextView";
self.textView.editable = NO;
[self.view addSubview: self.textView];
//[self.view addSubview:navigationController.view];
}
Any ideas what I am missing? Thanks for helping.
You want to show a UINavigationController on top of a UITextView? That doesn’t make too much sense. Why are you trying to do that?
You can show the UINavigationController over the current UIViewController by doing this: