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

ios7 获取UITablleViewCell

2013-11-18 17:01 239 查看
iOS7之前UITablleViewCell中得contentView得superView就是UITableViewCell。但是在iOS7得时候,contentView得superView确实UITableViewCellScrollView.UITableViewCellScrollView得superView才是UITableViewCell。考虑到也许之后发生同样得时候,所以如果需要重子View查找指定类型得父视图。考虑使用自定义函数实现

- (UIView*)superviewWithClass:(Class)class child:(UIView*)child

{

UIView *superview = nil;

superview = child.superview;

while (superview != nil && ![superview isKindOfClass:class]) {

superview = superview.superview;

}

return superview;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: