iOS 获取操作系统的版本
[[[UIDevice
UITableView *tableView = nil;
float Version=[[[UIDevice currentDevice] systemVersion] floatValue];
if(Version>=7.0) {
tableView = (UITableView *)self.superview.superview;
}
else {
tableView=(UITableView *)self.superview;
}
NSIndexPath *indexPath= [tableView indexPathForCell:self];
indexPath = [NSIndexPath indexPathForRow:kImage1Index inSection:indexPath.row];if ([tableView isKindOfClass:NSClassFromString(@"UITableView")] && tableView.style == UITableViewStyleGrouped) {
// need no background because otherwise this would overlap the rounded corners
_attributedTextContextView.backgroundColor = [DTColor clearColor];
}
本文详细介绍了如何在iOS应用中获取当前设备的操作系统版本,并根据不同版本对UITableView进行特定的样式调整。针对不同版本的UITableView特性,文章提供了一种灵活的适配策略,确保了界面的一致性和用户体验。
151

被折叠的 条评论
为什么被折叠?



