[[UIScreen mainScreen] scale]详解
当屏幕分别为640x940时[[UIScreen mainScreen] scale]=2.0
当屏幕分别为320x480时[[UIScreen mainScreen] scale]=1.0

由于iphone 早起的设备都是屏幕分辨率是320*480
后来apple 在iPhone 4中采用了名为Retina的显示技术,iPhone 4采用了960x640像素分辨率的显示屏幕,相当于iPad屏幕78%的像素 。由于屏幕大小没有变化,还是3.5float scale = [[UIScreenmainScreen] scale];//得到设备的分辨率
scale = 1; 的时候是代表当前设备是320*480的分辨率(就是iphone4之前的设备)
scale = 2; 的时候是代表分辨率为640*960的分辨率

 

相关文章:

  • 2021-05-17
  • 2021-11-28
  • 2021-06-26
  • 2023-03-20
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2021-07-28
  • 2022-12-23
相关资源
相似解决方案