The navigation bar is managed by the stack operation of push and pop, and as such, each item itself has many properties that we can customize.
Item, understood from the English language, can be interpreted as an item, so the item is not a simple label title, nor is it a simple button, which is an abstraction of a project managed in the navigation bar. It's a little hard to understand, and with the code, we can understand the meaning of item very well.
Here are some methods and properties
1 //Ns_class_available_ios (2_0) @interface uinavigationitem:nsobject <NSCoding>2 //3 //Initializes a uinavigationitem with text4-(Instancetype) Initwithtitle: (NSString *) title Ns_designated_initializer;5-(Nullable Instancetype) Initwithcoder: (Nscoder *) coder Ns_designated_initializer;6 //7 //set and get text for Uinavigationitem8@property (Nullable, nonatomic,copy) NSString *title;//Title when topmost in the stack. Default is nil9 //set a view type of item:Ten@property (Nullable, Nonatomic,strong) UIView *titleview;//Custom view to use in lieu of a title. May is sized horizontally. Only used when item was topmost on the stack. One A //The text appears above the item: -@property (nullable,nonatomic,copy) nsstring *prompt __tvos_prohibited;//explanatory text to display above the navigation bar buttons. - the //A uinavigationitem can also contain many barbuttonitem,barbuttonitem that are a series of buttons that appear on the left or right side of the navigation bar - //Set Back button -@property (Nullable,nonatomic,strong) Uibarbuttonitem *backbarbuttonitem __tvos_prohibited;//Bar button Item to use for the back button in the navigation item. - // + //set to hide the previous back button when push comes out with a new item -@property (nonatomic,assign) BOOL Hidesbackbutton __tvos_prohibited;//If YES, this navigation item would hide the back button when it's on top of the stack. +- (void) Sethidesbackbutton: (BOOL) Hidesbackbutton animated: (bool) animated __tvos_prohibited; A // at ///* Use these properties to set multiple items in a navigation bar. - //The older single properties (Leftbarbuttonitem and Rightbarbuttonitem) now refer to - //The first item in the respective array of items. - // - //Note:you ' ll achieve the best results if your use either the singular properties or - //The plural properties consistently and don ' t try to mix them. in // - //Leftbarbuttonitems is placed in the navigation bar left-to-right with the first to //item in the outside edge and left aligned. + //Rightbarbuttonitems is placed right-left with the first item in the list at - //The right outside edge and right aligned. the // */ * //set left and right button groups $@property (nullable,nonatomic,copy) nsarray<uibarbuttonitem *> *leftbarbuttonitems Ns_available_ios (5_0);Panax Notoginseng@property (nullable,nonatomic,copy) nsarray<uibarbuttonitem *> *rightbarbuttonitems Ns_available_ios (5_0); -- (void) Setleftbarbuttonitems: (Nullable nsarray<uibarbuttonitem *> *) Items Animated: (BOOL) animated Ns_available_ios (5_0); the- (void) Setrightbarbuttonitems: (Nullable nsarray<uibarbuttonitem *> *) Items Animated: (BOOL) animated Ns_available_ios (5_0); + // A ///* By default, the Leftitemssupplementbackbutton property is NO. In the case, the //The back button isn't drawn and the left item or items replace it. If You + //Would like the left items to appear in addition to the back button (as opposed to instead of it) - //set Leftitemssupplementbackbutton to YES. $ // */ $ //whether to hide the back button, - @property (nonatomic) BOOL Leftitemssupplementbackbutton Ns_available_ios (5_0) __tvos_prohibited; - // the ////Some navigation items want to display a custom left or right item is they ' re on top of the stack. - ////A Custom left item replaces the regular back button unless your set Leftitemssupplementbackbutton to YESWuyi //set left and right buttons the@property (Nullable, Nonatomic,strong) Uibarbuttonitem *Leftbarbuttonitem; -@property (Nullable, Nonatomic,strong) Uibarbuttonitem *Rightbarbuttonitem; Wu- (void) Setleftbarbuttonitem: (Nullable Uibarbuttonitem *Item Animated: (BOOL) animated; -- (void) Setrightbarbuttonitem: (Nullable Uibarbuttonitem *Item Animated: (BOOL) animated; About // $ @end
Uinavigationitem is something on Uinavigationbar.