NSString *text=@"this is the test";
CGSize constraintSize;
constraintSize.width = rect1.size.width;
constraintSize.height = MAXFLOAT;
CGSize sizeFrame =[text sizeWithFont: [UIFont systemFontOfSize:16]
constrainedToSize:constraintSize
lineBreakMode: UILineBreakModeWordWrap];
textview.text=text;
[textView setFrame:CGRectMake(0, 0, 310, sizeFrame.height+40)];
UITextview的高度适应问题
最新推荐文章于 2018-07-18 23:16:11 发布
本文探讨了如何使用Objective-C编程语言实现文本大小限制、布局调整与视图框架的集成,通过设置字体大小、约束尺寸及文本框大小,实现高效、灵活的UI设计。
1459

被折叠的 条评论
为什么被折叠?



