iphone xcode Landscape mode by default

前端 未结 2 1033
温柔的废话
温柔的废话 2021-01-21 14:04

how can I set an iphone app to start in Landscape mode? and stays that way

2条回答
  •  盖世英雄少女心
    2021-01-21 14:51

    Marcelo's answer is not correct, because UIInterfaceOrientationLandscape is not a valid identifier and thus brings up a build fail.

    progrmr's answer is correct:

    return interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight;
    

    (Apologies for not commenting on the first answer, but I didn't have enough reputation points when I wrote this...)

提交回复
热议问题