2
votes

I have a custom UIView with a certain appearance. I want it so if the width of the UIView changes due to code setting its autolayout width constraint, I want to react to the change by changing the appearance accordingly - one example of this would be to set the corner radius.

How can my custom UIView react to size changes caused by autolayout constraint on a UIView?

1
Can you update them in layoutSubviews?i_am_jorf

1 Answers

4
votes

Override layoutSubviews:

- (void)layoutSubviews {
    [super layoutSubviews];
    [self updateCornerRadius];
}