Customize the stroke color of the title text in the UINavigationBar view

Is there any problem with adjusting the color of the hatching text on the navigation bar? If you have the following code

[[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Copperplate" size:19],
                                                       NSForegroundColorAttributeName:[UIColor whiteColor],
                                                       NSStrokeColorAttributeName:[UIColor colorWithRed:215/255.0f green:75/255.0f blue:40/255.0f alpha:1],
                                                       NSStrokeWidthAttributeName:@-3.0
                                                       }]; UI_APPEARANCE_SELECTOR;

The font name and color are displayed in order, but the color and stroke width are not displayed in the user interface. Has anyone understood this?

+4
source share

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


All Articles