菜鸟教程小白 发表于 2022-12-12 14:00:52

ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体)


                                            <p><p>背景:
字体使用:AppleSDGothicNeo-Light</p>

<p>ios支持:ios7+</p>

<p>问题:
我通过以下方式设置 uilabel 的字体:</p>

<pre><code>self.lblName.font = ;
</code></pre>

<p>我的预期:
<img src="/image/ZemSD.png" alt="character C at iosFonts.com"/> </p>

<p>我在iOS7中得到的(iOS8还可以):</p>

<p> <img src="/image/R3zph.png" alt="Character C in iOS7"/> </p>

<p>当我想打印调试描述时,它得到了:
font-family: "AppleSDGothicNeo-Light";字体粗细:正常;字体样式:正常;字体大小:12.00pt</p>

<p>发生了什么?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>希望对你有帮助..</p>

<pre><code>UIFont *myFont = ;
;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体),我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/28272856/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/28272856/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体)