您的位置:首页 > 产品设计 > UI/UE

IOS 7.1 兼容性bug 问题,UIButton,UILabel ...

2014-03-26 11:13 1171 查看
前面我们测试都通过的程序,昨天我修复了几个bug后做回归测试,突然发现了好几个bug,瞬间吓坏我了,差点就还原了版本,但我还是耐着性子找了,最后,也就是今天上午,我才定定位出问题所在,原来是升级IOS 7.1后,系统默认的好多组件啥的,逻辑方式发生下改变,也就是出现了些兼容性问题。

我发现的这个问题是UIButton的,我发现,当给一个button的enable设置为NO后,如果想再更新它的title,background,就没法更新。

兼容方案是:先恢复enable为YES,然后再更新,最后再还原。

类似代码:

/**
*传递实体和序号
**/
-(void)setEntity:(TripNode *)dataEntity andDayIndex:(int)index
{
self.dataEntity = dataEntity;
NSLog(@"index :%d",index);
self.leftOperationButton.enabled = YES;
if (self.style == TPUpdateTripBranchHeaderStyleTo) {
[self.leftOperationButton setTitle:[NSString stringWithFormat:@"D%d",index] forState:UIControlStateNormal];
self.leftOperationButton.enabled = NO;
}else if (self.style == TPUpdateTripBranchHeaderStyleAdd) {
[self.leftOperationButton setTitle:@"" forState:UIControlStateNormal];
} else if (self.style == TPUpdateTripBranchHeaderStyleFrom) {
[self.leftOperationButton setTitle:@"From" forState:UIControlStateNormal];
self.leftOperationButton.enabled = NO;
}else if (self.style == TPUpdateTripBranchHeaderStyleReturn) {
[self.leftOperationButton setTitle:@"Return" forState:UIControlStateNormal];
self.leftOperationButton.enabled = NO;

}
}

其他的几个兼容性问题我就不一一列举了,上stackoverflow上一搜关键字:

ios 7.1 not working

你就会发现一大大堆的类似问题:http://stackoverflow.com/search?q=ios+7.1+not+working

具体解决方案,自己根据个人情况找吧,祝你们好运!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息