Swift - Make layout smaller for one device

寵の児 提交于 2019-12-25 09:34:07

问题


So I don't get the point to develop for 3,5 devices if the layout view is bigger than that, now some of the layouts doesn't fit in the 3.5 devices, what is the best way to solve it, I am already using Size Classes and Auto Layout. Is there any way to make things smaller just for the 3,5?


回答1:


You can check @HAS answer for a great extension to get the device. You can simply add his extension to any file you want (outside of the class body).

Then you check your device type like that:

let model = UIDevice.currentDevice().modelName

if(model == "iPhone 4" || model == "iPhone 4S"){
    //do iPhone 4 stuff
}else{
    //do other stuff
}


来源:https://stackoverflow.com/questions/28199110/swift-make-layout-smaller-for-one-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!