How to adjust an UIButton's imageSize?

前端 未结 16 2122
时光说笑
时光说笑 2021-01-29 21:40

How can I adjust the image size of the UIButton? I am setting the image like this:

[myLikesButton setImage:[UIImage imageNamed:@\"icon-heart.png\"] forState:UICo         


        
16条回答
  •  花落未央
    2021-01-29 22:31

    Here is the other solution to scale an imageView of UIButton.

    button.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
    

提交回复
热议问题