We usually need to add some buttons on the ios ui. And these buttons. Currently, these buttons are more inclined to be added to the top of the UI, such
How to do this:
First, uinavigationbar inherits from uiview. To add a button, you must use the uinavigationitem class. It is a necessary class for adding controls to the navigation bar.
After querying the API, it is found that uinavigationbar and uinavigationitem are a pair of siblings, always inseparable, and there is a method
-(Void) Pushnavigationitem :(Uinavigationitem*) Item animated :(Bool) Animated;
The uinavigationitem should be obtained on the uinavigationbar. The title, left, and right are set on the uinavigationitem.
Uinavigationitem :-(ID) Initwithtitle :(Nsstring*) Title; set the title
Uinavigationitem: @ Property(Nonatomic,Retain)
Uibarbuttonitem* Leftbarbuttonitem; the same applies to left and right.