【问题标题】:UIButton image always to be 80 point away from titleUIButton 图像始终距离标题 80 点
【发布时间】:2016-02-06 13:09:24
【问题描述】:

我已使用此方法将图像设置为距离标题 80 点。按钮在这里有蓝色背景。

    self.btnErrorMsg.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 80);

问题是如果文本较长,它会与文本重叠。我该怎么办?

【问题讨论】:

    标签: ios objective-c uibutton


    【解决方案1】:

    你可以使用:

    button.titleEdgeInsets = UIEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right);
    

    它非常适合我

    【讨论】:

    • 如果文本是动态的(超长或超短),那就不行了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-29
    • 2021-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-28
    相关资源
    最近更新 更多