iphone - UIButton titleLabel 行数在 iOS5 上工作正常但在 iOS4.3 上不工作

标签 iphone ios uibutton

我正在为 UIButtontitleLabel 设置 numberOfLines :

btnMailAddress.titleLabel.numberOfLines = 3;  

iOS5 设备中,文本显示为 3 行,但在 iOS4.3 设备中,文本仅适合 1 行。

最佳答案

尝试将其设置为零。

btnMailAddress.titleLabel.numberOfLines = 0;  

来自属性 numberOfLinesUILabel 文档。

For using as many lines as needed, set the value of this property to 0.

关于iphone - UIButton titleLabel 行数在 iOS5 上工作正常但在 iOS4.3 上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8921575/

相关文章:

iphone - iPhone 支持的音频文件格式

C# Winforms : programatically display Button's Hover State

ios - 如何订阅更改图像

ios - 协议(protocol)扩展和子类

swift - 更改 UINavigationbar 中元素的色调颜色(iOS 11)

ios - 如何通过 UIButton 传递参数

iphone - 订阅一个 url 以在 ical 中添加事件

javascript - 在 iPhone 上使用 Safari Mobile 打开弹出窗口中的 URL 时出现问题。忽略参数

iphone - 如何子类化 UITextView : Implement a horizontal swipe

ios - 为什么 AppDelegate 继承自 UIResponder?