float scale = [[UIScreenmainScreen] scale];//得到设备的分辨率

 

[imageView setContentScaleFactor:[[UIScreen mainScreen]scale]];

将设备的分辨率赋给imageView。

 

好像是这样,当scale=1的时候,不缩放,当scale=2就放大二倍,当scale=0。5,宽高就成为原来一半了 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2021-12-06
  • 2021-12-30
相关资源
相似解决方案