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

前端 未结 8 2057
暗喜
暗喜 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]];
    }
    

提交回复
热议问题