iOS Universal Development – Use of Tilde Sign (~) in Xib File and Image Name for differentiation

前端 未结 1 2015
自闭症患者
自闭症患者 2020-12-09 11:53

While developing universal apps, we have to write a conditional code for each device – the iPad as well as the iPho

相关标签:
1条回答
  • 2020-12-09 12:31

    For differentiating XIB file for iPhone and iPad :

    The magical ~ will help you. You can use it, to differentiate between iPhone and iPad assets / xib files.

    Your file should end with ~iphone.xib or ~ipad.xib.

    Note: It's case sensitive don't use iPad or iPhone.

    Check that each xib file has all outlets connected and has the correct fileowner set. If some are missing, iOS could decide not to use them and use the iPhone files instead.

    For differentiating Images for iphone and ipad

    Platform-specific modifiers—Use the modifiers ~iphone or ~ipad to specify images targeting a specific size of device.

    Official document InfoPlistKeyReference

    0 讨论(0)
提交回复
热议问题