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

here

someTf.font = [UIFont fontWithName:@"AlexBrush-Regular" size:20];

This is working correctly no need to give .ttf ext

Share:
11,964

Related videos on Youtube

scourGINHO
Author by

scourGINHO

Updated on October 16, 2022

Comments

  • scourGINHO
    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
    scourGINHO almost 11 years
    Nope, 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
    Dharmbir Singh almost 11 years
    see my this answer may be it will be helpful. stackoverflow.com/questions/16581191/…
  • scourGINHO
    scourGINHO almost 11 years
    Nope, 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
    Madhu almost 11 years
    Did you try setting 'NeuropolMedium' as the font name? i.e. [UIFont fontWithName:@"NeuropolMedium" size:20]
  • Chandni
    Chandni almost 6 years
    any example for swift