scaledValueForValue: called on a font that doesn't have a text style set

前端 未结 8 2021
暗喜
暗喜 2020-12-24 01:46

I am currently using the Xcode 6 pre release (not beta) and the simulator on OS X 10.10 Yosemite beta 7. I am trying to build a project developed in xcode 6, but the app cra

相关标签:
8条回答
  • 2020-12-24 02:04

    This problem is still present in iOS 8.0.2 but seems to be fixed in 8.1.

    My workaround was to set the custom font only if iOS is greater than 8.0.2:

    #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
    
    ...
    
    if (SYSTEM_VERSION_GREATER_THAN(@"8.0.2")) {
        [[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setFont:[UIFont fontWithName:@"Helvetica" size:14.0]];
    }
    
    0 讨论(0)
  • 2020-12-24 02:14

    Okay I finally figured it out.

    This occurs when grouped table views have section headers and possibly footers. As a temporary workaround I am just removing the headers/footers from the grouped tableviews, but if you really need the font you can create a custom header view by overriding the "viewForHeaderInSection", and setting the font on your custom view's label.

    Still, this is definitely a bug in iOS 8 and hopefully it will be fixed soon.

    0 讨论(0)
提交回复
热议问题