Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 iPhone 应用程序中使用 OHAttributeLabel 但现在我收到警告
UITextAlignment is deprecated : You should use setTextAlignment:lineBreakMode:on your NSAttributedString instead
请任何人建议我如何解决它。
尝试这个
[label setTextAlignment:NSTextAlignmentCenter];
这是工作
// 假设标签是 OHAttributedLabel 的 IBOutlet(子类哦 UILabel)
label.textAlignment = UITextAlignmentJustify;
// 仅此而已,OHAttributedLabel 为您完成所有需要的工作!