1

是否可以将选项卡的字体大小更改为 MDCTabBar ?

MDCTabBar 是 google 库的一部分,用于在 iOS 中使用设计材料

https://github.com/material-components/material-components-ios

4

1 回答 1

-2
CGFloat width = [UIScreen mainScreen].bounds.size.width;
UIFont *font = [MDCTypography buttonFont];
if (width <= 320.0) {
    font = [UIFont fontWithName:@"Dosis-Medium" size:12];
} else if (width <= 375.0) {
    font = [UIFont fontWithName:@"Dosis-Medium" size:14];
} else {
    font = [UIFont fontWithName:@"Dosis-Medium" size:15];
}
self.tabBar.unselectedItemTitleFont = font;
self.tabBar.selectedItemTitleFont = font;
于 2017-12-13T17:15:35.823 回答