网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

iOSLabel随字自动变大效果

一、效果图。

成都创新互联公司基于成都重庆香港及美国等地区分布式IDC机房数据中心构建的电信大带宽,联通大带宽,移动大带宽,多线BGP大带宽租用,是为众多客户提供专业成都服务器托管报价,主机托管价格性价比高,为金融证券行业服务器托管,ai人工智能服务器托管提供bgp线路100M独享,G口带宽及机柜租用的专业成都idc公司。

iOS Label随字自动变大效果

二、工程图。

iOS Label随字自动变大效果

三、代码。

RootViewController.h

#import 
//添加HPGrowingTextView头文件
#import "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];
 
 
 
 
}

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持创新互联。


本文名称:iOSLabel随字自动变大效果
网页路径:http://bjjierui.cn/article/gopegg.html

其他资讯