开发者

How can I alter the height of a UIView using CGAffineTransformScale?

开发者 https://www.devze.com 2023-04-13 08:54 出处:网络
Is it possible to change the height of a UIView alone using CGAffineTransformScale? I do not want to entirely scale my UIView. I just wa开发者_开发技巧nted to increase the height alone?Something like

Is it possible to change the height of a UIView alone using CGAffineTransformScale?

I do not want to entirely scale my UIView. I just wa开发者_开发技巧nted to increase the height alone?


Something like this:

view.transform = CGAffineTransformMakeScale(1.0, 2.0);

Will make your view twice as high but the same width. However, transforms are applied after rasterisation so you'll just get the original pixels stretched out, you won't reveal any extra detail. You should also be aware, from the UIView documentation, that if transform is set to anything other than the identity then frame becomes undefined.


You may not use transform. Better to set the frame of the UIView. Since this really change the height of the view.

view.frame=CGRectMake(0,0,100,200);

0

精彩评论

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

关注公众号