UITableViewCell 在IOS7的父视图是UITableViewWrapperView。

来源:互联网 发布:网络在线客服职责 编辑:程序博客网 时间:2024/06/05 09:31

iOS 获取操作系统的版本

[[[UIDevice currentDevice] systemVersion] floatValue]

<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];}



0 0
原创粉丝点击