国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 商南县| 民丰县| 筠连县| 滦平县| 云霄县| 汾西县| 长汀县| 牡丹江市| 乌恰县| 达日县| 修文县| 昭觉县| 淅川县| 时尚| 晋州市| 惠来县| 广西| 内乡县| 扶绥县| 策勒县| 石河子市| 宁乡县| 保山市| 澎湖县| 东光县| 昌黎县| 南郑县| 康定县| 高要市| 讷河市| 东乡族自治县| 江津市| 遂平县| 新绛县| 剑川县| 油尖旺区| 紫云| 富源县| 安远县| 清镇市| 英德市|