iphone - UINavigationController facing some problems -
I have created a UINavigationController in the UIView controller class where I program
- ( Zero) viewDidoadload [[Super Viewedload]; Self.title = @ "Hmmm"; Navigation Controller = [[UINavigationController alloc] init]; // Without this education, tableView appears blocked; navigationController.view.frame = CGRectMake (0, 0, 768, 1004); // & lt; NavigationController.navigationBar.barStyle = UIBarStyleDefault should fill the newly controller screen; NavigationController.title = @ "Hello"; [Navigation Controller Navigationbar Set Handled: No]; [Self.view addSubview: navigationController.view]; CGRect frame = CGRactam (100, 70, 200, 50); UIButton * button = [UIButtonTypeRoundedRect] with UIButton Button; Button.frame = frame; [Button Situation: @ State for "seed": UControlStateAnimal]; [Button addTarget: Self-action: @selector (myButtonClick :) forControlEvents: (UIControlEvents) UIControlEventTouchDown]; [Self.view addSubview: button]; } Now click on the button Event
- (zero) myButtonClick: (ID) sender {SAPRetailExCustomerSalesOrderDetailViewTVC * customerSalesOrderDetailViewTVC = [[SAPRetailExCustomerSalesOrderDetailViewTVC alloc] initWithNibName: @ "SAPRetailExCustomerSalesOrderDetailViewTVC" bundle: zero]; [Navigation Push ViewController: CustomerSalesOrderDetailViewTVC Animated: Yes]; [CustomerSalesOrderDetailViewTVC release]; } Here is navigating the view in the output but the button resides in my view !!! Apart from this, I have to click twice to get the button back in my navigation controller. That's because I do not have a title for my navigation bar, how do I set a title here? Can someone help me ???
"itemprop =" text "> Your UIViewController should be in the navigation controller's child and not in other ways round. Your UIViewController is not responsible for its own navigation controller
Use UINavigationController's -initWithRootViewController: .. Where you can make your UIViewController object and add the view of the Navigation Controller to the window
What you are doing is incorrect: You see the view of the Navigation Controller add to the controller!
Comments
Post a Comment