Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Constraints of Cell Subview

Tags:

I have a custom cell & I am trying to update constraints of subview as below:

CustomeCell.m

-(void)layoutSubviews
{
    [super layoutSubviews];

    _con_view_width.constant = _lbl_property.frame.size.width;
    if(!_btn_imageCount.isHidden)
    _con_view_width.constant = _lbl_property.frame.size.width + _btn_imageCount.frame.size.width;

    NSLog(@"%@",NSStringFromCGRect(_view_lbl_btn.frame));

    [_view_lbl_btn updateConstraintsIfNeeded];
    NSLog(@"%@",NSStringFromCGRect(_view_lbl_btn.frame));

}

Problem The constraint are working only after reload rows when scrolling