【问题标题】:CGSize sizeSpace = [@" " sizeWithFont:self.fontHashtag constrainedToSize:rect.size lineBreakMode:self.lineBreakMode]; [duplicate]CGSize sizeSpace = [@" " sizeWithFont:self.fontHashtag constrainedToSize:rect.size lineBreakMode:self.lineBreakMode]; [复制]
【发布时间】:2016-07-21 13:01:36
【问题描述】:
CGSize sizeSpace = [@" " sizeWithFont:self.fontHashtag constrainedToSize:rect.size lineBreakMode:self.lineBreakMode];

如何从代码中删除deprecated 警告?

我是新人,请您详细解释一下吗?

【问题讨论】:

    标签: ios objective-c xcode7


    【解决方案1】:

    sizeWithFontdepreciated 所以你需要使用sizeWithAttributes 方法。

    CGSize sizeSpace = [@" " sizeWithAttributes:@{NSFontAttributeName:self.fontHashtag}];
    

    【讨论】:

    • 谢谢你成功了
    • 欢迎朋友。你可以在这里查看其他attributeHappy Coding :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-31
    • 1970-01-01
    • 1970-01-01
    • 2013-05-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多