Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

Why doesn't my Cordova/PhoneGap iOS app rotate when the device rotates?

I am trying to make a landscape only app, but I am not able to produce any rotation at all.

There used to be a autorotate setting in PhoneGap.plist but in phonegap 1.8.0 I can find it. Does it still exists?

What else could be wrong that my application is not rotating?

UPDATE

I know have webpage containing only one word "test". I set target device to iPad only and enabled all four orientations. What could still be wrong?

Do need to have a special html document type? Do I need to include some cordova-1.8.0.js? I could not find one for iOS (!?!) so i tested it with the android version. I read the API is now the same so can I use the android .js file?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I tried the JavaScript solution above and got no joy In Visual Studio 2015 I change the config.xml to

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

taken from Cordova 5 build command is deleting iOS device orientation settings

I didn't need the javascript just the config setting


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...