One.
Two, engineering drawings.
Three, code.
RootViewController.h
#import <UIKit/UIKit.h>// Add Hpgrowingtextview header file "HPGrowingTextView.h"@interface rootviewcontroller:uiviewcontroller{hpgrowingtextview *TextView;} @end
Rootviewcontroller.m
- (void) viewdidload{[Super Viewdidload];//Do any additional setup after loading the view.TextView = [[Hpgrowingtextview alloc] Initwithframe:cgrectmake (10,100,240,40)]; Textview.isscrollable =NO; Textview.contentinset = Uiedgeinsetsmake (0,5,0,5); Textview.minnumberoflines =1; Textview.maxnumberoflines =6;//You can also set the maximum height in points with maxheight// textview.maxheight = 200.0f; textview.returnkeytype = Uireturnkeygo; //just as an example textview.font = [Uifont systemfontofsize:15.0f"; TextView. delegate = self; TextView.internalTextView.scrollIndicatorInsets = Uiedgeinsetsmake (5, 0, 5, 0); Textview.backgroundcolor = [Uicolor Greencolor]; textview.placeholder = @" type to see the TextView grow!; [Self.view Addsubview:textview]; }
"Code Note" Ios-label automatically becomes larger with Word