美文网首页
小技巧-UITableViewCell

小技巧-UITableViewCell

作者: Jacob_LJ | 来源:发表于2018-04-25 11:16 被阅读7次
小技巧 image.png

1

问题:Autolayout布局的cell内subView自定义圆角(上下左右)
cell.contentView
--------- a view
-------------b view

解决方法:确保设置圆角view的父控件已经布局完成,然后调用圆角view的父控件进行子控件强制布局

- (void)layoutSubviews {
    [super layoutSubviews];
    [self.bView.superview layoutIfNeeded];
    [self.bView ja_roundCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight) radius:8];
}

参考:由使用Masonry布局不能立即获取到frame想到的一些问题
记录日期:2018年04月25日

相关文章

网友评论

      本文标题:小技巧-UITableViewCell

      本文链接:https://www.haomeiwen.com/subject/bqvelftx.html