Is it possible to customise the font of the delete button in a UITableView
?
Asked
Active
Viewed 1,551 times
3 Answers
3
In the delete button of UITableViewCell
the system font is used. So if you want to change the system font in your app just override -systemFontOfSize:(CGFloat)fontSize
:
Create category UIFont+System
and place this code inside .m
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
+ (UIFont *)systemFontOfSize:(CGFloat)fontSize {
return [UIFont fontWithName:@"NameOfYourFont" size:fontSize];
}
#pragma clang diagnostic pop

lukas
- 2,300
- 6
- 28
- 41

Oleh Kudinov
- 2,533
- 28
- 30
0
Maybe take a look at this question
You could use an image with the font you want and then set the button to this image. May be problematic if you have different languages
-1
You can take advantage of
UIButton * buttonAppearance = [UIButton appearanceWhenContainedInInstancesOfClasses:@[[YourCustomCell class]]];
[buttonAppearance setAttributedTitle: attributedString forState: UIControlStateNormal];
Note: This will set the title to all the buttons in your cells. You can then change it if required.

Bonnie
- 4,943
- 30
- 34
-
doesn't seem to be working in iOS 11. not sure if it worked prior – markturnip Nov 29 '17 at 02:37