在某些iPhone和iPod设备中,UILabel backgroundcolor没有更新

在某些iPhone和iPod设备中,UILabel backgroundcolor没有更新,iphone,uilabel,Iphone,Uilabel,我正在为iphone应用程序中的自定义日历动态创建30个UIButtons。我还在每个UIButton中添加UILabel作为子视图。我正在为每个UILabel设置不同的背景色 当我尝试更改UILabel的背景色时,在一些iPhone设备上,它工作正常,但在一些iPod touch和iPhone设备上,它没有显示任何颜色。它的行为就像我设置了clearColor 这是我加载一个单元格的基本代码。我将此逻辑保持在循环中,并使用UIButton数组创建多个单元格: calenderCell = [U

我正在为iphone应用程序中的自定义日历动态创建30个UIButtons。我还在每个UIButton中添加UILabel作为子视图。我正在为每个UILabel设置不同的背景色

当我尝试更改UILabel的背景色时,在一些iPhone设备上,它工作正常,但在一些iPod touch和iPhone设备上,它没有显示任何颜色。它的行为就像我设置了clearColor

这是我加载一个单元格的基本代码。我将此逻辑保持在循环中,并使用UIButton数组创建多个单元格:

calenderCell = [UIButton buttonWithType:UIButtonTypeCustom];
calenderCell.frame = CGRectMake(xOffset, yOffset, cellWidth, cellHeight);
calenderCell.backgroundColor = [UIColor clearColor];
[calenderCell addTarget:self action:@selector(calenderCellClicked:)  
                          forControlEvents:UIControlEventTouchUpInside];

calenderCellDate=[[UILabel alloc] initWithFrame:CGRectMake(1.0,1.0, cellWidth-1.0, cellHeight-1.0)];
calenderCellDate.text = [NSString stringWithFormat:@"%ld",dateValue];
calenderCellDate.textAlignment = UITextAlignmentCenter;
calenderCellDate.font = [UIFont fontWithName:@"Trebuchet MS" size:15.0];
calenderCellDate.backgroundColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1.0];
calenderCellDate.textColor = [UIColor colorWithRed:0.44 green:0.44 blue:0.44 alpha:1.0];
[calenderCell addSubview:calenderCellDate];
[calenderCellDate release];
有人知道这个代码有什么问题吗

谢谢你的帮助

谢谢,

吉姆

我明白了。存在与区域和区域设置相关的问题。对我们来说,它运行良好,但对于中国、德国、意大利等其他地区,由于一些日期的比较,上述代码未被执行

这段代码一切正常

谢谢,
吉姆