ios - 如何创建类别/子类 UILabel 以更改标签颜色或文本样式
<p><p>我想在 Objective-C 中创建类别,这将是 UILabel 的子类,因此在帮助下我可以更改应用程序中所有 UILabel 的标签颜色。请提出一些建议。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>苹果说:</p>
<p>“基础的 UILabel 类为标签文本的简单和复杂样式提供支持。您还可以控制外观的各个方面,例如标签是使用阴影还是高亮绘制。如果需要,您可以自定义通过子类化进一步显示您的文本”。</p>
<p>检查这两个链接:
1. <a href="https://stackoverflow.com/questions/19686275/how-to-subclass-ui-elements-like-uilabel-uibutton" rel="noreferrer noopener nofollow">How to Subclass UI elements like UILabel, UIButton</a> .
2. <a href="https://stackoverflow.com/questions/10004466/subclassing-uilabel" rel="noreferrer noopener nofollow">SubClassing UILabel</a> </p></p>
<p style="font-size: 20px;">关于ios - 如何创建类别/子类 UILabel 以更改标签颜色或文本样式,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/39609519/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/39609519/
</a>
</p>
页:
[1]