gpt4 book ai didi

Swift 4 以编程方式设置自定义字体

转载 作者:搜寻专家 更新时间:2023-10-30 21:49:00 24 4
gpt4 key购买 nike

如何以编程方式将自定义字体设置为 UILabel 或任何其他 UIView(如果可能)我知道如何在 Storyboard 中做到这一点,但不知道如何以编程方式做到这一点谢谢

这就是我所做的 enter image description here

最佳答案

你可以试试

lbl.font = UIFont(name:"FontAwesome",size:15)

名称应该是安装时的字体名称。不是因为你的文件名是 Noto Kufi Arabic 而不是 NotoKufiArabicRegular

click the font and open it with Font Book , then install it after that specify exactly the name shown in the parameter in the line above

关于Swift 4 以编程方式设置自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50978284/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com