UIImageView change Width and Height

后端 未结 8 790
-上瘾入骨i
-上瘾入骨i 2021-02-13 10:12

I\'ve read various posts on here asking similar questions... I\'ve tried various ways that were posted including bounds and frames etc. including the following:



        
8条回答
  •  迷失自我
    2021-02-13 10:51

    Well, if your read the documentation about UIIMage you can notice that is impossible to change any parameter of an UIImage after create it, the solution I've implemented for use high quality images for change some parameter of (for example) the SliderControl as Screw Image, is the next one:

    UIImage *tumbImage= [UIImage imageNamed:@"screw.png"];
    UIImage *screw = [UIImage imageWithData:UIImagePNGRepresentation(tumbImage) scale:2];
    

    With that, I can to use 100x100 px image in my apps scaled to 50%.

    Kind regards.

提交回复
热议问题