iOs device-specific resources not working - ~iPad loading default XIB - universal app

前端 未结 2 406
醉话见心
醉话见心 2021-02-04 20:16

I\'m making a universal app based on the Utility App template. I\'ve selected a universal app and the MainView.xib and MainView~iPad.xib work properly on both device types.

2条回答
  •  情歌与酒
    2021-02-04 20:46

    It can be done automatically based on the name, no worries. The only problem is you'll need to switch your naming convention. MainView.xib will be your iPad xib and MainView~iphone.xib will be your iPhone xib. Then it should work perfectly for you and you don't have to do anything but alloc/init.

    You can check out my other answer on this topic here: iOS: Using device modifiers for loading xib files?

提交回复
热议问题