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