我遇到了仅在 iOS7 中出现的 MKNumberBadgeView 问题。在initState中,我有,self.textColor = [UIColor whiteColor];但是当显示 numberBadge 时,文本颜色为黑色。
我对 MKNumberBadgeView 类所做的唯一更改是更改CGSize numberSize = [numberString sizeWithFont:self.font];为,CGSize numberSize = [numberString sizeWithAttributes:@{NSFontAttributeName:self.font}];因为 sizeWithFont 在 iOS7 中已被贬值。
有谁知道为什么它不使用我告诉它使用的颜色?
谢谢
编辑:
我已经进行了一些调查,这似乎sizeWithAttributes是这里的问题。我使用另一个第三方类创建了一个徽章,当我添加sizeWithAttributes. 我已经尝试过CGSize numberSize = [numberString sizeWithAttributes:@{NSFontAttributeName:self.font, NSForegroundColorAttributeName:[UIColor whiteColor]}];,但仍然无法正常工作。