UIlabel 具有 numberOfLines 属性。它说我的字符串有 2 行。但是当我使用 UItextview 时,我想根据 UITextview 中的文本长度来拆分行数。我该怎么做?UIlabel 自动拆分,但 UITextview 不这样做。
问问题
1161 次
2 回答
0
UITextView 本质上允许多行文本。你只需用“/n”字符分隔你的行,你就完成了。
于 2009-11-30T09:05:10.857 回答
0
行应由“\r”分隔
这是一个例子:
lblNeedSubscription = [[UILabel alloc] initWithFrame:frame];
[lblNeedSubscription setNumberOfLines:0]; // allows as many lines as needed
[lblNeedSubscription setText:@"To access content\ryou need to be a paid subscriber"];
于 2010-07-07T06:07:26.817 回答