iOS 获取操作系统的版本
[[[UIDevice
<pre name="code" class="objc">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应用中获取当前设备的操作系统版本,并通过版本比较实现不同版本间的特定功能逻辑,包括TableView组件的样式切换和背景处理。
421

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



