How can I disable landscape orientation?

后端 未结 9 2164
忘掉有多难
忘掉有多难 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:11

    If you want to disable landscape orientation for both iPhone and iPad.

    Go to Targets and Go to the General tab. See the below screen and deselect landscape left and landscape right.

    Here in this case only iPhone landscape mode will be disabled not for iPad. For iPad all modes are anabled. If you want select device option from Universal to iPad. It will looks like this. See below screen.

    Now you need to deselect all modes except Portrait for iPad. See below screenshot.

    Now you successfully disabled all modes except Portrait for all devices.

提交回复
热议问题