ios - UITableViewCell 更改删除行按钮的字体

标签 ios objective-c uitableview fonts

是否可以在 UITableView 中自定义删除按钮的字体?

最佳答案

UITableViewCell的删除按钮中使用系统字体。因此,如果您想更改应用程序中的系统字体,只需重写 -systemFontOfSize:(CGFloat)fontSize :

创建类别UIFont+System并将此代码放入.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

关于ios - UITableViewCell 更改删除行按钮的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26202045/

相关文章:

ios - Apple App 链接打不开,而是要求 itunes

ios - 如何实现像 iCarousel Rotary 类型、Objective-C 这样的 UI?

ios - UINavigationBar:以编程方式更改字体

objective-c - 为什么会导致 "mutating method sent to immutable object"异常?

ios - UITableViewCells 中的图像加载错误

ios - 苹果推送通知服务 ssl 证书已过期?

ios - 在 xib 中为界面生成器创建一个圆圈

ios - 如何在 Objective-C 中格式化 Instagram 日期

ios - 在 UITableView 单元格 iOS Swift 中突出显示搜索结果

ios - 正在使用 tableView :willSelectedRowAtIndexPath: correct way to pass variable?