chenjie-ios
在ios开发的过程中,有可能这里应用在iphone和ipad上都要使用,但是怎么判断当前设备是iphone还是ipad呢,在这里提供一种方法来判断这个设备是什么设备,具体代码如下
  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
  //当前设备是iPhone
} else {

  //当前设备是iPad
}

分类:

技术点:

相关文章:

  • 2022-01-12
  • 2021-10-16
  • 2021-04-12
  • 2021-06-07
  • 2021-05-03
  • 2021-05-19
  • 2021-08-09
  • 2022-01-11
猜你喜欢
  • 2021-10-05
  • 2021-10-05
  • 2021-12-15
  • 2021-11-05
  • 2021-12-05
  • 2021-11-22
  • 2021-12-13
相关资源
相似解决方案