Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova : iOS and iPad stuck in portrait mode

Tags:

ios

ipad

cordova

I added the following to the config.xml in the root

<preference name="orientation" value="default" />

but it seems to have no effect, the app is stuck in portrait mode. I also made sure to disable orientation lock.

Any ideas ?

<?xml version='1.0' encoding='utf-8'?>
        <widget id="com.ameba.mobile.api" android-versionCode="5" version="1.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
            <preference name="SplashScreen" value="splash" />
            <preference name="SplashScreenDelay" value="3000" />
    .......
            <content src="index.html" />
            <plugin name="cordova-plugin-whitelist" version="1" />
            <access origin="*" />
            <platform name="android">
                <allow-intent href="market:*" />
            </platform>
            <platform name="ios">
                <preference name="orientation" value="default" />
                <allow-intent href="itms:*" />
                <allow-intent href="itms-apps:*" />
            </platform>
        </widget>
like image 994
Fabii Avatar asked Dec 21 '25 20:12

Fabii


1 Answers

It's a bug, default orientation for iPad should be all orientations

Anyway, if you want to have all orientations on iPhone and iPad, you can use the "all" orientation value

<preference name="orientation" value="all" />
like image 81
jcesarmobile Avatar answered Dec 23 '25 14:12

jcesarmobile



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!