iOS Dev Uinavigation Series three--toolbar Uitoolbar

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.