Ios--uitextview How to use multiple lines of text input and display details

Source: Internet
Author: User
Tags set background

Ios--uitextview How to use multiple lines of text input and display details

The common method of Uitextview is mainly used to enter and display multiple lines of text information.

Uitextview *onetextview = [[Uitextview alloc] init];

Onetextview.frame = CGRectMake (0, 20, 320, 200); Set Location

Onetextview.backgroundcolor = [Uicolor Whitecolor]; Set Background color

Onetextview.alpha = 1.0; Set transparency

Onetextview.text = @ "18331000747 [email protected] [email protected] www.baidu.com"; Set text

Onetextview.textalignment = Nstextalignmentcenter; Set the font to its way

Onetextview.font = [Uifont boldsystemfontofsize:25.5f]; Set Font size

Onetextview.textcolor = [Uicolor Redcolor]; Set Text color

[Onetextview Seteditable:yes]; can be edited when set

Onetextview.datadetectortypes = Uidatadetectortypeall; Display the connection mode of the data type (e.g. phone number, URL, address, etc.)

Onetextview.keyboardtype = Uikeyboardtypedefault; Set the type of pop-up keyboard

Onetextview.returnkeytype = Uireturnkeysearch; Set the type of Returen key on the keyboard

onetextview.scrollenabled = YES; Whether sliding is allowed when the text width exceeds the width of the Uitextview

[Self.view Addsubview:onetextview]; Add to view

[Onetextview release], Onetextview = nil; Freeing memory

Several common methods of proxy

Going to start editing

-(BOOL) textviewshouldbeginediting: (Uitextview *) TextView;

Going to end the edit

-(BOOL) textviewshouldendediting: (Uitextview *) TextView;

Start editing

-(void) textviewdidbeginediting: (Uitextview *) TextView;

End Edit

-(void) textviewdidendediting: (Uitextview *) TextView;

Content is going to change edit

-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) Range Replacementtext: (NSString *) text;

Content changes Edit

-(void) Textviewdidchange: (Uitextview *) TextView;

The focus has changed.

-(void) Textviewdidchangeselection: (Uitextview *) TextView;

How to use the input and display of multiple lines of text in Ios--uitextview details

Related Article

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.