Why is my UIView not growing with CGAffineTransformMakeScale?

后端 未结 2 1594
醉话见心
醉话见心 2021-01-27 09:48

My goal is to make a view grow double in size. The result I get with the code I have is \"nothing happens\". The view displays but doesn\'t grow. Any help would be appreciated.<

2条回答
  •  不知归路
    2021-01-27 09:53

    The problem is that this is a view transform and you are using auto layout. Auto layout works by setting the frame of your view. Thus you apply a transform and then auto layout comes along and changes it back again.

    I regard this as a major bug ever since the introduction of auto layout; it's as if the auto layout people did not think deeply enough about how iOS works before they introduced this feature. See my "essay" on this topic here: https://stackoverflow.com/a/14105757/341994

提交回复
热议问题