UI 13th Lesson

Source: Internet
Author: User

Main content: Label view (Uitabbarcontroller)

First, the use of the scene




Uitabbarcontroller is divided into three levels

Important attributes of Uitabbarcontroller

Property Meaning
Viewcontrollers Display View Controller
TabBar tab bar
Delegate Agent
SelectedIndex Select a Tabbaritem

Second, Uitabbar

1, Tabbar is Uitabbar object contains more than Uitabbaritem,

2, each of the tabbaritem corresponds to a viewcontroller,tabbar height is 49

3, when the Tabbaritem more than 5, the system will automatically add a more button, click More Buttons, the rest of the buttons will not appear at the bottom of the list is displayed in the form of

4, Tabbar properties: Tintcolor, Bartintcolor, image settings

5, Tabbaritem can set tittle, image, Badgevalue

If you want to set all the navigation controller color by one button, similar to the function of one key of QQ, can operate through the Uiappearance protocol, it can make some space to customize color operation, etc.

Third, Block

Block is an anonymous function that implements callback functions for a function, for communication between pages, and for passing values.

Attention:

1, the definition attribute receives block, must use Copy,retain invalid, namely retain and assign will cause the wild pointer question

2, block in a method defined when stored in the stack, in another class using the need to copy, stored in the heap area

3, when the Block is not used to destroy, Block_release ()

4, in the block implementation part, cannot use the instance variable directly, the self calls the property, because the block will cause the self reference count +1, eventually causes the circular reference question

5. All issues to use __block to resolve circular references

Block implementation callback function, clear, simplified code

UI 13th Lesson

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.