UITextField font style not changing
11,964
Solution 1
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.
Solution 2
You doing wrong Because no need to set extension (fontname.ttf) in your string.
textField.font = [UIFont fontWithName:@"NEURM TTF" size:20];
and check following links how to use custom font in ios.
1.How to use custom font in iOS Apps?
2.iPhone Development: how to use custom fonts?
Solution 3
someTf.font = [UIFont fontWithName:@"AlexBrush-Regular" size:20];
This is working correctly no need to give .ttf ext
Related videos on Youtube
Author by
scourGINHO
Updated on October 16, 2022Comments
-
scourGINHO over 1 year
I have the following problem - I want to change the UITextField font to a custom one. I am using this line of code:
textField.font = [UIFont fontWithName:@"fontname.ttf" size:20];
I want to use this font: Neurm.ttf Can you please tell me what is wrong or just try it out and tell me is it working?
-
scourGINHO almost 11 yearsNope, I am doing everything right. I tried the way you told me but still no result. I think its because of this font, can you please try it and tell me what is the result?
-
Dharmbir Singh almost 11 yearssee my this answer may be it will be helpful. stackoverflow.com/questions/16581191/…
-
scourGINHO almost 11 yearsNope, I am doing everything right. I tried the way you told me but still no result. I think its because of the specific font, can you please try it and tell me what is the result?
-
Madhu almost 11 yearsDid you try setting 'NeuropolMedium' as the font name? i.e. [UIFont fontWithName:@"NeuropolMedium" size:20]
-
Chandni almost 6 yearsany example for swift