Setting mask layer on UITableViewCell's subview overrides Auto Layout constraints

后端 未结 2 1759
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 22:03

I have a UITableViewCell with multiple subviews. One of the subviews is a UILabel and the cell\'s height is dynamically sized based on the amount of te

2条回答
  •  梦毁少年i
    2021-02-04 22:26

    I have had same problem and doing things in - (void)drawRect:(CGRect)rect does the work but it could be costly in terms of performance.

    You can call your clipping or shadow methods in perform selector

    [self performSelector:@selector() withObject:nil afterDelay:0.0000001 ];//a very low delay
    

提交回复
热议问题