2012-01-25 6 views
0

UITextViewの上にUINavigationControllerを表示します。ただし、ナビゲーションコントローラは表示されません。 UITextViewのみが表示されます。UITextViewの上にUINavigationControllerを表示する方法は?

これは私がそれを表示しようとしている方法です:

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]; 

} 

私が行方不明です何任意のアイデア?助けてくれてありがとう。

答えて

1

UITextViewの上にUINavigationControllerを表示したいですか?それはあまり意味がありません。なぜあなたはそれをしようとしていますか?

あなたはこれを行うことにより、現在のUIViewControllerを超えるUINavigationControllerを表示することができます。

[self presentModalViewController:navigationController]; 
関連する問題