国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

iOS Label隨字自動變大效果

2020-07-26 02:48:39
字體:
來源:轉載
供稿:網友

一、效果圖。

二、工程圖。

三、代碼。

RootViewController.h

#import <UIKit/UIKit.h>//添加HPGrowingTextView頭文件#import "HPGrowingTextView.h"@interface RootViewController : UIViewController<HPGrowingTextViewDelegate>{ 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];    }

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宣汉县| 伊宁县| 乌审旗| 读书| 长葛市| 永丰县| 平乐县| 灌阳县| 吴旗县| 海南省| 镇沅| 将乐县| 建德市| 高碑店市| 潞城市| 龙胜| 鄂温| 黄平县| 辛集市| 大余县| 文化| 罗平县| 尼玛县| 沁源县| 中阳县| 凯里市| 武宁县| 金秀| 余干县| 英超| 武胜县| 台湾省| 平山县| 措勤县| 宜城市| 华容县| 内江市| 偏关县| 阿拉善右旗| 三原县| 广灵县|