为什么我的UIView没有使用CGAffineTransformMakeScale增长? [英] Why is my UIView not growing with CGAffineTransformMakeScale?

查看:146
本文介绍了为什么我的UIView没有使用CGAffineTransformMakeScale增长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是让视图的大小增加一倍。我得到的代码的结果是没有任何反应。视图显示但不会增长。任何帮助将不胜感激。

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.

这是.H文件

Here's the .H file

这是.M文件中的自定义方法

这是对方法的调用(仍然在.M文件中)

Here's the custom method in the .M file Here's the call to the method (still in the .M file)

推荐答案

当你看到广场时在屏幕上,转型已经发生。尝试将缩放代码放在viewDidAppear而不是viewWillAppear。

When you see the square on screen, the transformation is already happened. Try putting the scaling code in viewDidAppear instead of viewWillAppear.

另一个小注释:你忘了打电话

Another small remark: you forgot to call

[super viewWillAppear]. 

这篇关于为什么我的UIView没有使用CGAffineTransformMakeScale增长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆