最佳答案
There are many ways to do it, one of those is you can use auto layouts and differentiate between iPad and iPhone using size classes.
Add a variation in size inspector if you are using storyboards. For iPhones its Compact width and Regular height and for iPads its Regular width and Regular heights.You can visit this link https://www.bignerdranch.com/blog/designing-for-size-classes-in-ios/ for more details.
If you are doing through code then you can differentiate between iPhone and iPadusing below code snippet
if UIDevice().userInterfaceIdiom == .phone {
//This is iPhone
//Here Provide your content size for iPhone
}
else {
//This is iPad
//Here Provide your content size for iPad
}
关于ios - 我怎样才能获得 ios 应用程序的响应能力,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57057424/