Ios iPhone6中缺少的piechat片段对iphone5很好

Ios iPhone6中缺少的piechat片段对iphone5很好,ios,objective-c,ios10,pie-chart,iphone-6,Ios,Objective C,Ios10,Pie Chart,Iphone 6,我正在使用图表。iPhone6s(iOS 10.2.1)中的Piechart片段丢失,但同样的代码适用于iPhone5s(iOS 10.2.1)和iPhone5s(iOS 10.2.1) 这是我的密码: - (void)viewDidAppear:(BOOL)animated { CGRect pieFrame = CGRectMake(30, 78, 240, 240); self.chart = [[BNPieChart alloc] initWithFrame:pieFr

我正在使用图表。iPhone6s(iOS 10.2.1)中的Piechart片段丢失,但同样的代码适用于iPhone5s(iOS 10.2.1)和iPhone5s(iOS 10.2.1)

这是我的密码:

- (void)viewDidAppear:(BOOL)animated {

    CGRect pieFrame = CGRectMake(30, 78, 240, 240);
    self.chart = [[BNPieChart alloc] initWithFrame:pieFrame];

    BNColor *emergencyColor = [BNColor colorWithRed:142.0/255.0 green:1.0/255.0 blue:32.0/255.0];
    BNColor *urgentColor = [BNColor colorWithRed:231.0/255.0 green:133.0/255.0 blue:8.0/255.0];
    BNColor *nonUrgentColor = [BNColor colorWithRed:97.0/255.0 green:147.0/255.0 blue:3.0/255.0];

    self.chart.colors = [NSArray arrayWithObjects:emergencyColor,urgentColor,nonUrgentColor, nil];

    [self.chart addSlicePortion:emergencyCount/totalCount withName:[NSString stringWithFormat:@"%.1f%%",(emergencyCount/totalCount)*100]];
    [self.chart addSlicePortion:urgentCount/totalCount withName:[NSString stringWithFormat:@"%.1f%%",(urgentCount/totalCount)*100]];
    [self.chart addSlicePortion:nonUrgentCount/totalCount withName:[NSString stringWithFormat:@"%.1f%%",(nonUrgentCount/totalCount)*100]];

    [self.view addSubview:self.chart];
}
在iphone6上,其唯一的显示渐变深灰色圆圈,具有外观图像:

但它在iPhone5(iOS 10.2.1)上运行良好


实际上,它需要在
BNPieChart
类本身中更改。
CGFloat
float*
BNPieChart.m
中的任何地方替换以下代码行:

//  CGFloat red, green, blue;
//  [self getRGBForIndex:index red:&red green:&green blue:&blue];

观察
viewdime
以获得结果。如果有人像我一样实现了
BNPieChart
,它就可以正常工作

CGFloat red, green, blue;
BNColor *color = [colors objectAtIndex:(index % [colors count])];
red = color.red;
green = color.green;
blue = color.blue;