Control properties for iOS learning notes

Source: Internet
Author: User

1. Text box

Set Password properties: Secure Text Entry tick;

Set text box with clear properties: Clear Button =is always visible; The default is without the Purge attribute: never appears

Set text box by default with the Text property: placeholder= user-defined input;

Set the text box keyboard user input to complete the hidden code:

[Self.text resignfirstresponder];//applies to a single text box when input is complete hidden

[Self.view endediting:yes];//applies to all text boxes when input is complete and hidden;

2. Button

Set highlight status: State Config =highlighted (highlight) default (default state);

Set the default state and highlight the button background picture properties: background= user-defined image name, such as img_01;

3. Properties

Highlighed adjusts Image highlight state click No reflection
User Interaction Enabled whether to interact with users 4, set status bar//Change status bar text color to White
-(Uistatusbarstyle) Preferredstatusbarstyle
{
return uistatusbarstylelightcontent;
}
Hide the status bar
-(BOOL) Prefersstatusbarhidden
{
return YES;
} Uialertview * Alerview = [[Uialertview alloc] initwithtitle:@ "Operation Tips" message:@ "Congratulations on customs clearance! "Delegate:nil cancelbuttontitle:@" OK "otherbuttontitles:@" OK ", nil];
Show dialog box
[Alerview show];
Setting Userview to interact with users
Self.userview.userInteractionEnabled =yes;
Clear all controls
[Self.userview.subviews makeobjectsperformselector: @selector (Removefromsuperview)];//Add a click event @selector to USERBTN ( Optiondataclick:) to upload the currently clicked button to the event [Userbtnaddtarget:self action: @selector (Optiondataclick:) forControlEvents: UIControlEventTouchUpInside]; Declare empty string variables when stitching using nsmutablestring* userinput =[nsmutablestring string]; Stitching [Userinput Appendstring:data]; Delay 0.5 seconds Call method
[Self Performselector: @selector () Withobject:nil afterdelay:0.5];
Displays a child control in the view to the top
[Self.view BringSubviewToFront:self.btnIcon];

Control properties for iOS learning notes

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.