IOS: common attributes of UINavigationController
// Push from the current view to the target view. If the view already exists, the stack [self. navigationController pushViewController: commentListVC animated: YES]; // returns the previous controller [self. navigationController popViewControllerAnimated: YES]; // returns a controller [self. navigationController popToViewController: [[UIViewController alloc] init] animated: YES]; // return to the root view [self. navigationController popToRootViewControllerAnimated: YES]; // After B pop returns A, whether B is released depends on whether the subsequent Code uses B again. If the subsequent code still uses B, the memory occupied by B is retained. In one case, if the memory is extremely insufficient, IOS may release B according to certain policies, B is re-created when it is used again. In addition, even if B is no longer used in the code after pop, B's memory may only be released, and the release time is not certain, this depends on the recycle policy of the garbage collector. // remove the text of the return button to display self. navigationItem. backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @ "" style: Custom target: nil action: NULL]; // custom left/right navigation Item 1 UIButton * btn1 = [UIButton buttonWithType: upload]; UIButton * btn2 = [UIButton buttonWithType: Upload]; UIBarButtonItem * bar1 = [[UIBarButtonItem alloc] handler: btn1]; handler * bar2 = [[Alibaba alloc] handler: btn2]; // left and right navigation items in the navigation bar. You can customize buttonself. navigationItem. leftBarButtonItem = bar1; self. navigationItem. rightBarButtonItem = bar1; // you can add multiple entries, followed by an array. The order of the entries is self. navigationItem. leftBarButtonItems = @ [bar1, bar2]; self. navigationItem. rightBarButtonItems = @ [bar1, bar2]; // custom left and right navigation Item 2 viewController. navigationItem. rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage: [UIImage imageNamed: @ "navItem_course"] style: adjust target: self action: @ selector (showCourse :)]; viewController. navigationItem. leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle: @ "" style: UIBarButtonItemStylePlain target: self action: @ selector (logOut :)]; // set the title view of the navigation bar, you can customize a view and a label. navigationItem. titleView // The back button background is white [self. navigationBar setTintColor: [UIColor whiteColor]; [self. navigationBar setTitleTextAttributes: [NSDictionary attributes: COLOR_WITH_RGB (230,230,230), UITextAttributeTextColor, [UIFont boldSystemFontOfSize: 18366f], fingerprint, nil]; // set the navigation bar color [self. navigationBar labels: [UIImage imageWithColor: COLOR_WITH_RGB (70, 70, 70) size: CGSizeMake (SCREEN_WIDTH, KNav_Height)] forBarMetrics: UIBarMetricsDefault]; // hide navigationBarself. navigationController. navigationBarHidden = YES;