xcode UITextField 字体样式没有改变
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16582137/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
UITextField font style not changing
提问by scourGINHO
I have the following problem - I want to change the UITextField font to a custom one. I am using this line of code:
我有以下问题 - 我想将 UITextField 字体更改为自定义字体。我正在使用这行代码:
textField.font = [UIFont fontWithName:@"fontname.ttf" size:20];
I want to use this font: Neurm.ttfCan you please tell me what is wrong or just try it out and tell me is it working?
我想使用这种字体: Neurm.ttf你能告诉我有什么问题吗,或者只是尝试一下然后告诉我它是否有效?
采纳答案by Madhu
Its possible you may have not gone through some necessary steps to embed a custom font in your app.
您可能没有通过一些必要的步骤在您的应用程序中嵌入自定义字体。
Check;
查看;
and see if you missed anything.
看看你是否错过了什么。
回答by Dharmbir Singh
You doing wrong Because no need to set extension (fontname.ttf) in your string.
你做错了因为不需要在你的字符串中设置扩展名 (fontname.ttf)。
textField.font = [UIFont fontWithName:@"NEURM TTF" size:20];
and check following links how to use custom font in ios.
并检查以下链接如何在 ios 中使用自定义字体。
1.How to use custom font in iOS Apps?