Label of the UI component

Source: Internet
Author: User

Use Core data interface, link database

Portrait portrait mode

LandScape (left, right) landscape mode

1. After the program starts, enter from the main interface, the main function calls the Uiapplicationmain function, creates an application UIApplication object, UIApplication represents the entire application. Single-Instance class

2. Create a proxy object for the application that listens to the application's lifecycle, and calls the appropriate protocol method to handle the change

3. Turn on Event loops

The first two parameters of the Uiapplicationmain function directly take the parameters in the main function

The third parameter represents an application class, typically a uiapplication class or its subclasses

The fourth parameter is its proxy class

Lazy loading: When and when to apply for space;

Status bar height is 20 pixels

Only one form per application for displaying the user interface

Self.window=[[uiwindow Alloc]init];

[UIScreen Mainscreen] Gets the device's screen object

Set the form as the primary (in response to the user's) Form and set the form to visible

[Self.window makekeyandvisible];

This protocol method is called when the application loses focus

-(void) Applicationwillresignactive: (uiapplication *) application;

This protocol method is called when the application enters the background

-(void) Applicationdidenterbackground: (uiapplication *) application;

This protocol method is called when the application enters the foreground

-(void) Applicationwillenterforeground: (uiapplication *) application;

This protocol method is called when the application receives focus and only the application has the focus to respond to the user's actions

-(void) Applicationdidbecomeactive: (uiapplication *) application;

This protocol method is called when an application is terminated

-(void) Applicationwillterminate: (uiapplication *) application;

This protocol method is called when the application receives a memory warning

-(void) applicationdidreceivememorywarning: (uiapplication *) application;

Label Property Description: Used to display one or more lines of text and cannot interact with the user

Assume that you create a Label object label

Used to set text content

[Email protected] "my label";

Used to set the label's position and size (x,y,width,height)

Label.frame=cgrectmake (10,30,100,40);

Used to set the label's background color

Label.backgroundcolor=[uicolor Yellowcolor];

The color used to set the text

Label.textcolor=[uicolor Greencolor];

Used to set the horizontal alignment of text (centered)

Label.textalignment=nstextalignmentcenter;

Use to set text font size

Label.font=[uifont BOLDSYSTEMFONTSIZE:20];

To set the shadow color, you must also set the offset value of the shadow

Label.shadowcolor=[uicolor Bluecolor];

Label.shadowoffset=cgsizemake ( -5,-5);

Sets the color of the text when the highlight state is set, and must also set the state

Label.highlightedtextcolor=[uicolor Blackcolor];

Label.highlighted=yes;

Sets whether lable automatically adjusts the font size to fit the width of the entire label

Label.adjustsfontsizetofitwidth=yes;

Set the number of rows, 0 for indeterminate number of rows, and the corresponding number of rows by size and content

label.numberoflines=0;

Set truncation mode when label is not sufficient to display all content

Label.linebreakmode=nslinebreakbytruncatingtail;

Nslinebreakbycharwrapping: Wrapping in characters, truncating content in characters

Nslinebreakbywordwrapping: Wrapping in words, truncating content in words

Nslinebreakbyclipping: Wrapping in words, truncating content in characters

Nslinebreakbytruncatinghead: To ... Omit the previous content, if there are multiple lines, ... will be placed on the last line

Nslinebreakbytruncatingmiddle: Omit intermediate content ..., if there is more than one line, omit the middle of the last line

Nslinebreakbytruncatingtail: Omit the following content, the final content with ... Said

Set transparency, 1 opaque, 0 for full transparency

label.alpha=0.3;

Set whether to hide

Label3.hidden=no;

Label of the UI component

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.