iOS Dev Uinavigation Series three--toolbar Uitoolbar
In addition to Uinavinationbar in iOS, there is also a toolbar uitoolbar for us to use, the toolbar and navigation bar is very similar, but the function is more simple, there are uibarbuttonitem buttons in the toolbar, in the first two blogs, A discussion of navigation bars and navigation items, with the following address:
uinavigationbar:http://my.oschina.net/u/2340880/blog/527706
uinavigationitem:http://my.oschina.net/u/2340880/blog/527781
The navigation bar usually appears in the head of the view, which, in contrast, usually appears at the bottom of the view, which can be filled with buttons that give the user some action. Create a toolbar as follows:
Self.view.backgroundColor = [Uicolor Graycolor]; Uitoolbar * tool = [[Uitoolbar alloc]initwithframe:cgrectmake (0, self.view.frame.size.height-40, 320, 40)]; [Self.view Addsubview:tool];
Here are some of the methods in Uitoolbar, most of which are involved in the Uinavigationbar, here are just a brief introduction:
The style of the toolbar, similar to the navigation bar, has both black and white @property (nonatomic) uibarstyle barstyle; //set the button array on the toolbar @property (nullable, Nonatomic,copy) nsarray<uibarbuttonitem *> *items; //Set whether the toolbar is transparent @property (nonatomic, assign,getter=istranslucent) bool translucent; //Set toolbar button- (void) Setitems: (nullable nsarray<uibarbuttonitem *> *) items animated: (BOOL) animated; //set Item style color @property ( Null_resettable, nonatomic,strong) uicolor *tintcolor;//setting toolbar background color @property (nullable, Nonatomic,strong) uicolor *bartintcolor;//Settings toolbar background and hatch pattern- (void) SetBackgroundImage: (Nullable uiimage *) Backgroundimage fortoolbarposition: (uibarposition) Toporbottom barmetrics: ( Uibarmetrics) barmetrics;- (nullable uiimage *) backgroundimagefortoolbarposition: (UIBarPosition) Toporbottom barmetrics: (uibarmetrics) barmetrics;- (void) Setshadowimage: (nullable uiimage * ) shadowimage fortoolbarpositIon: (uibarposition) toporbottom;- (nullable uiimage *) Shadowimagefortoolbarposition: ( uibarposition) Toporbottom;
iOS Dev Uinavigation Series three--toolbar Uitoolbar