首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >iOS 9:按钮上的黑色背景和某些设备上的性能错误

iOS 9:按钮上的黑色背景和某些设备上的性能错误
EN

Stack Overflow用户
提问于 2015-11-19 18:45:21
回答 1查看 149关注 0票数 0

我们有这样一种情况:4个iPads中有3个按预期运行我们的应用程序,然后在没有加载大量(x,y)点的应用程序上,与屏幕截图唯一不同的地方是导航中"< Back“按钮上的黑色背景。它看起来也像iOS 5和6上的旧后退按钮?(更新:阅读Rm彩评论关于“按钮形状”设置的一般>可访问性)

VS

版本为9.0.2(13A452),只提供Wi,型号为MD510LL/A。

VS.

版本为9.0.2(13A452),运营商为Verizon 21.1,型号为MD524LL/A

黑色按钮之一是一个iPad第4代运行的iOS 9和有旧的学校黑人背景,只有该设备?我将window.tintColor改为黑色,以修复白色文本不可读的UIAlertAction错误,所以这可能解释了部分原因?

图形问题

主要关注的是,当加载核心绘图时,在一小部分设备上的时间间隔增量循环中,所有x值都保持在零。我以前见过32位设备无法做到这一点,而第4代是32位。然而.我个人已经测试了一个iPad第4代和上面的第二个相同的规格。

在我的测试device...as上,一切都如预期的那样工作,因为只有Wi、Verizon/ATT以及对这些问题的所有32位/64位解释的差异--我发现这很有帮助:http://www.everymac.com/systems/apple/ipad/ipad-air-faq/differences-between-ipad-air-ipad-4th-gen.html

iOS 9中的一些新设置,如“低功耗模式”,是否会在无线网络不可用的情况下影响使用Verizon数据计划的网络能力?这就是目前的情况,包括正在使用VPN的设备。

,这是两个运行同一个应用程序的不同设备!--一个有黑色背景的设备在加载图形数据时有问题。在iOS 9中是否有一个新的设置会导致设备间的这些奇怪的差异/错误?

注意:最近发现一个用户的iPhone 6s+有相同的图形错误,所以这不仅仅是iPad相关的.

下面是如何从SOAP响应对象填充(x,y)共形:

代码语言:javascript
运行
复制
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"MM/dd/yyyy h:mm:ss a"];

if (unitCount == 0)
    {
        DataHistory_object *dho = [[DataHistory_object alloc] init];
        dho.dataDate = [attributeDict objectForKey:@"Date"];
        NSLog(@"dho.dataDate: %@",dho.dataDate);
        dho.dataValue = [attributeDict objectForKey:@"Value"];
        float dataValue = [dho.dataValue floatValue];

        newDate = [dateFormat dateFromString:dho.dataDate];
        [[NSUserDefaults standardUserDefaults] setObject:dho.dataDate forKey:@"firstDate"];

        //@"start" is defined in a separate class
        if (![[[NSUserDefaults standardUserDefaults] objectForKey:@"start"] isEqualToString:dho.dataDate])
        {
            NSDate *start = [dateFormat dateFromString:[[NSUserDefaults standardUserDefaults] objectForKey:@"start"]];
            firstDate = [dateFormat dateFromString:dho.dataDate];
            NSTimeInterval secondsBetween = [firstDate timeIntervalSinceDate:start];
            interval = secondsBetween;
            NSString *startDate = [NSString stringWithFormat:@"%@",[dateFormat stringFromDate:newDate]];
            NSLog(@"firstDate: %@",startDate);
            NSLog(@"unitCount == 0 if: %d - interval: %f",unitCount,interval);
        }
        else
        {
            NSLog(@"unitCount == 0 else: %d - interval: %f",unitCount,interval);
        }

        if (trendIndex == 0)
        {
            [dataHistoryArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 1) 
        {
            [dataHistoryArray2 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 2) 
        {
            [dataHistoryArray3 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 3) 
        {
            [dataHistoryArray4 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 4) 
        {
            [dataHistoryArray5 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 5) 
        {
            [dataHistoryArray6 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 6) 
        {
            [dataHistoryArray7 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }

        oldDate = newDate;

        unitCount++;
    }
    else
    {
        DataHistory_object *dho = [[DataHistory_object alloc] init];
        dho.dataDate = [attributeDict objectForKey:@"Date"];
        dho.dataValue = [attributeDict objectForKey:@"Value"];
        float dataValue = [dho.dataValue floatValue];

        newDate = [dateFormat dateFromString:dho.dataDate];

        NSTimeInterval secondsBetween = [newDate timeIntervalSinceDate:oldDate];
        interval = (interval + secondsBetween);
        NSLog(@"unitCount %d - interval: %f",unitCount,interval);

        if (trendIndex == 0) 
        {
            [dataHistoryArray addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 1)
        {
            [dataHistoryArray2 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 2) 
        {
            [dataHistoryArray3 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 3) 
        {
            [dataHistoryArray4 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 4) 
        {
            [dataHistoryArray5 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 5) 
        {
            [dataHistoryArray6 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }
        if (trendIndex == 6) 
        {
            [dataHistoryArray7 addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:interval],@"x",[NSNumber numberWithFloat:dataValue],@"y",nil]];
        }

        oldDate = newDate;

        unitCount++;

    }

以下是如何加载数组:

代码语言:javascript
运行
复制
-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot {

if ([(NSString *)plot.identifier isEqualToString:@"Blue"])
{
    return [dataHistoryArray count];
}
//...same code for other arrays and colors    

return 0;
}

-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index {

NSNumber *num;

if ([(NSString *)plot.identifier isEqualToString:@"Blue"])
{
    num = [[dataHistoryArray objectAtIndex:index] valueForKey:(fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y")];
    return num;
}
//...same for other arrays and colors

return 0;
}

在添加每一幅图之后,我还需要操作该图形:

代码语言:javascript
运行
复制
-(void)changePlotRange {
    y.orthogonalCoordinateDecimal = CPTDecimalFromFloat(appDelegate.lowY);
    plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
    plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat([[NSUserDefaults standardUserDefaults] floatForKey:@"secondsBetween"])];
    plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(appDelegate.lowY) length:CPTDecimalFromFloat(appDelegate.highY-appDelegate.lowY)];
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-22 15:10:43

意识到这不是最容易被接受的问题,我会用我发现的更新这篇文章。

一些用户报告图形左边的所有数据的绘图问题是由于那些在军事时间中运行的用户造成的。我使用NSDateFormatter的间隔计算从未考虑过这一点。最后,我为NSDateFormatter创建了一个类别,用于处理现有代码所期望的日期,而不管日期格式如何。

至于按钮颜色的差异,里克·麦迪在评论中回答了,所以我无法接受他的回答:

设备的黑色按钮已经启用了“按钮形状”选项下的通用=>可访问性在设置应用程序。这是在iOS 7.中添加的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33811983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档