1. Cannot scroll
self.scrollenabled = NO;
2. Normal font
[Uifont systemfontofsize:30.0f]
3. Bold font
[Uifont boldsystemfontofsize:30.0f]
4. Text Box offset
Self.textcontainerinset = Uiedgeinsetsmake (Textview_top_inset, Textview_left_inset, TEXTVIEW_BOTTOM_INSET,TEXTVIEW _right_inset);
5. Get Input status
[Self becomefirstresponder];
6. Is it possible to edit
[Self seteditable:yes];
7. Limit the input length
According to this idea, the text length to be generated = Original text length-select text length + Enter text length. Considering the deletion situation, my code is as follows:-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) range Replacementtext: ( NSString *) text{ if ([Text isequaltostring:@ ""] && range.length > 0) { //delete character must be safe return yes;< c3/>} else { if (textview.text.length-range.length + text.length > Max_input_length) { Uialertview * alert = [[Uialertview alloc] initwithtitle:@ "exceeds maximum input length" Message:nil delegate:self cancelbuttontitle:@ "OK" Otherbuttontitles:nil]; [Alert show]; return NO; } else { return YES;}} }
8. Cannot select
[Self setselectable:yes];
iOS Development Note TextView