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;
}
- (UIView*)superviewWithClass:(Class)class child:(UIView*)child
{
UIView *superview = nil;
superview = child.superview;
while (superview != nil && ![superview isKindOfClass:class]) {
superview = superview.superview;
}
return superview;
}
相关文章推荐
- ios7 获取UITablleViewCell
- IOS 6 和 IOS7 UITableViewCell上添加控件的获取
- ios 获取按钮所在的cell对象, 注意:ios7 =< System Version < ios8 获取cell对象的区别
- 获取TbaleViewCell的frame及cell点击动画
- ios 获取button所在的cell对象, 注意:ios7 =< System Version < ios8 获取cell对象的差别
- iOS7 (xCode5编译旧版本程序)获取到的iPhone5屏幕大小居然是320*480的问题
- iOS7中UITableViewCell的draw rect方法,不能画边框的问题
- 在UITableViewCell中获取它的父视图
- iOS7的一个小改动:indexPathForCell获取Button的NSIndexPath
- 6 Swift获取版本号和cell自定义方法传值
- 通过cell的UIButton获取UITableViewCell的行数及Cell数据
- 在ios7中获取唯一标识符(UDID/UUID)
- iOS小技巧 - 获取文字的宽度(iOS6与iOS7的方法不同)
- ios7,8上, TableViewCell里面的内容不显示的 一种情况
- iOS7 设置cell.accessoryType显示的颜色
- TableView的cell上面加button,实现点击button可以获取到cell的行号或者indexPath
- android 如何获取launcher的workspace中的每一个celllayout的位图???
- 获取当前cell
- 获取周围基站的信息 getNeighboringCellInfo
- IOS7以后,如何使用KeyChain保存和获取UDID