【发布时间】:2012-04-17 03:02:23
【问题描述】:
我需要帮助解决这个特殊问题。我有一个多项选择题应用程序,我可以选择 UITextview。有时,无论出于何种原因,选项 D 都会被减半。
截图:
不确定这里发生了什么。我基本上让 UITextView 框架调整到它的 contentSize。
CGRect dFrame = choiceD.frame;
dFrame.size.height = choiceD.contentSize.height;
choiceD.frame = dFrame;
有什么想法吗?提前致谢。
【问题讨论】:
-
UIButton没有contentSize属性,是吗?你得到contentSize的对象是什么类型的? -
choiceD知道它的宽度是固定的吗?如果您设置dFrame.size = choiceD.contentSize,它是否会通过使按钮太宽而无法提供可用空间来使其适合其文本?也可以尝试使用NSLog来显示前后的尺寸。 -
@warrenm 对不起,我的意思是 UITextView
标签: iphone objective-c ios uibutton contentsize