开发者

Creating and Resizing a UIImageView

开发者 https://www.devze.com 2023-01-19 14:04 出处:网络
I would like to be 开发者_运维问答able to add UIImageViews to my screen and also be able to re-size them, rotate them etc during run-time.

I would like to be 开发者_运维问答able to add UIImageViews to my screen and also be able to re-size them, rotate them etc during run-time.

How are the images resized, rotated etc.? Is openGl needed for this?

thanks


About resizing you can use the frame property of the UIImageView

About rotating, you should try applying a transform to the UIImageView like :

yourView.transform = CGAffineTransformMakeRotation(45.0*M_PI/180.0);

Good Luck !


You can use view .transform property to get scaling and rotation ( CGAffineTransform ) or you could go lower and use view layer and CoreAnimation power for more advanced effects.

Cheers, Krzysztof Zabłocki

0

精彩评论

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

关注公众号