ios6 升级 ios7 问题总结:
1. navigation controller的 back按钮出现重叠:
解决办法如下
if ([UINavigationBar instancesRespondToSelector:@selector(setBackIndicatorImage:)]) {
[[UINavigationBar appearance] setBackIndicatorImage:backButtonImage];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backButtonImage];
}else{
//ios 5 and 6 code
[[UIBarButtonItem appearance] setBackButtonBackgroundImage: backButtonImage forState: UIControlStateNormal barMetrics: UIBarMetricsDefault];
}
2. UITextview的内容会自动scroll,垂直不对齐
解决办法如下
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
NSRange range = NSMakeRange(self.textContent.text.length - 1, 1);
[self.textContent scrollRangeToVisible:range];
}
3 在ios6和 ios7 由 tablecell找到 父table的办法
- (UITableView *) findParentTableView:(UIView *) cell
{
UIView *view = cell;
while ( view && ![view isKindOfClass:[UITableView class]] )
{
view = view.superview;
}
return ( (UITableView *) view );
}