UIView frame, bounds and center

后端 未结 6 850
梦谈多话
梦谈多话 2020-11-22 10:40

I would like to know how to use these properties in the right manner.

As I understand, frame can be used from the container of the view I am creating. I

6条回答
  •  醉梦人生
    2020-11-22 11:20

    I think if you think it from the point of CALayer, everything is more clear.

    Frame is not really a distinct property of the view or layer at all, it is a virtual property, computed from the bounds, position(UIView's center), and transform.

    So basically how the layer/view layouts is really decided by these three property(and anchorPoint), and either of these three property won't change any other property, like changing transform doesn't change bounds.

提交回复
热议问题