How can I disable landscape orientation?

后端 未结 9 2149
忘掉有多难
忘掉有多难 2020-12-02 22:53

I am making an iPhone app and I need it to be in portrait mode, so if the user moves the device sideways, it does not automatically rotate. How can I do this?

9条回答
  •  隐瞒了意图╮
    2020-12-02 23:32

    Most simple solution separate for iPhone and iPad (Universal) - its remove unnecessary orientation in the info.plist file or Project -> Info -> Custom iOS Target Properties.

    Just add or remove orientation item from list:

    • Supported interface orientation for iPhone
    • Supported interface orientations (iPad) for iPad

提交回复
热议问题