UITextField font style does not change

I have the following problem: I want to change the font of UITextField to a custom one. I use this line of code:

textField.font = [UIFont fontWithName:@"fontname.ttf" size:20]; 

I want to use this font: Neurm.ttf Could you tell me what is wrong, or just try and tell me if it works?

+6
source share
3 answers

You may not have completed some of the necessary steps to embed a custom font in your application.

Check

and see if you missed something.

+1
source

You are mistaken because there is no need to install the extension (fontname.ttf) in your line.

 textField.font = [UIFont fontWithName:@"NEURM TTF" size:20]; 

and check the 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?

+11
source

here

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

This works fine, no need to give .ttf ext

0
source

Source: https://habr.com/ru/post/945131/


All Articles