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

首頁 > 系統 > iOS > 正文

iOS Label隨字自動變大效果

2019-10-21 18:46:24
字體:
來源:轉載
供稿:網友

一、效果圖。

iOS,Label,自動變大

二、工程圖。

iOS,Label,自動變大

三、代碼。

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];    }

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


注:相關教程知識閱讀請移步到IOS開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 勃利县| 沂源县| 休宁县| 伊金霍洛旗| 根河市| 嵊州市| 延寿县| 金寨县| 山东省| 吉林省| 剑川县| 汤阴县| 犍为县| 岚皋县| 望都县| 通化市| 太康县| 六枝特区| 阿拉善右旗| 安康市| 上杭县| 广饶县| 米脂县| 枞阳县| 南和县| 沙坪坝区| 合水县| 繁峙县| 清远市| 城市| 望江县| 阜阳市| 虞城县| 绵阳市| 竹溪县| 盐亭县| 永和县| 嘉祥县| 永丰县| 林周县| 苗栗市|