首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX
›
openkava
›
全部回复第 3 页 / 共 3 页
回复总数
44
1
2
3
❮
❯
2021-09-17 14:06:55 +08:00
回复了
herozzm
创建的主题
›
推广
›
继续抽奖送中秋福利(另有满减活动),回帖参与抽奖送整整大箱云南突尼斯软籽石榴(上一次中奖揭晓)
我要中奖
2014-08-29 15:51:18 +08:00
回复了
jtn007
创建的主题
›
iDev
›
求解关于 IOS 中一个 Label 自适应高度的问题。
UILabel *lbTeseTitle2 = [[UILabel alloc ] initWithFrame:CGRectMake(36, 24, titleView.width-40 ,50 )] ;
lbTeseTitle2.text = self.theItem[@"feature"] ;
lbTeseTitle2.font = SYSTEMFONT(14) ;
[lbTeseTitle2 setNumberOfLines: 0];
[tempView addSubview:lbTeseTitle2 ] ;
//设置一个行高上限
CGSize size = CGSizeMake(titleView.width-40,2000);
//计算实际frame大小,并将label的frame变成实际大小
CGSize labelsize = [ lbTeseTitle2.text sizeWithFont:lbTeseTitle2.font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
[lbTeseTitle2 setFrame: CGRectMake(36, 24, labelsize.width, labelsize.height)];
1
2
3
❮
❯
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
2939 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms ·
UTC 14:14
·
PVG 22:14
·
LAX 07:14
·
JFK 10:14
Developed with
CodeLauncher
♥ Do have faith in what you're doing.