开发者

UIView layer not resizing with view?

开发者 https://www.devze.com 2023-02-21 02:41 出处:网络
I added a CAGradientLayer to a custom UIView subclass\'s layer. I set the UIView autoresizing mask to UIViewAutoresizingFlexibleWidth. However the view resizes fine but the layer\'s frame does not res

I added a CAGradientLayer to a custom UIView subclass's layer. I set the UIView autoresizing mask to UIViewAutoresizingFlexibleWidth. However the view resizes fine but the layer's frame does not resize?? Is there a way to make that layer automatically resize when its view resizes?

Its pretty easy to fix this by manually resizing the layers frame but i would rather figure out 开发者_如何学Gowhy its not automatically resizing on its own.

thx


there's no layout manager in iOS. You need to resize your custom layers in your layoutSubviews.

0

精彩评论

暂无评论...
验证码 换一张
取 消