【问题标题】:How to restrict UITextView in 2 lines? [duplicate]如何将 UITextView 限制为 2 行? [复制]
【发布时间】:2011-11-12 01:15:25
【问题描述】:

可能重复:
Limit the number of lines for UITextview

谁能指导我,如何将 UITextView 限制为只有 2 行?在我的项目中,我必须使用 textview 但只有两行,我不知道该怎么做。 请帮忙!

【问题讨论】:

标签: iphone uitextview


【解决方案1】:

像这样,但我猜是门 UITextView:

// Putting a small label with some basic information on screen
UILabel *infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 800)];
infoLabel.numberOfLines = 2;

【讨论】:

  • 但我认为标签不会像 UITextView 那样工作
  • 问题是关于 UITextView 而不是 UILabel。 UITextView 没有 numberOfLines 这样的想法。
  • 这完全是错误的。
猜你喜欢
  • 2015-08-15
  • 2015-10-19
  • 2012-12-13
  • 1970-01-01
  • 2020-09-08
  • 2023-03-27
  • 2011-07-10
  • 1970-01-01
  • 2011-12-12
相关资源
最近更新 更多