ios - How to allow only these orientations in my Cordova/Phonegap app? -
i created ios (iphone) app using cordova , want allow following orientations:
- portrait
- landscape left
- landscape right
this means "upside down" should not allowed:
i know can set in xcode when ever start new cordova build setting gets overwritten.
so checked cordova docs , found this: http://cordova.apache.org/docs/en/5.1.1/config_ref_index.md.html#the%20config.xml%20file
it says can set orientation in config.xml this:
<preference name="orientation" value="landscape" />
but don't see how can set more fine granular setting described above. how can done?
note: on cordova 5.1.1
you can use config.xml'
<platform name="ios"> <preference name="orientation" value="all" /> </platform>
along shouldrotatetoorientation(degrees)
callback stated in docs this:
ondeviceready: function() { app.receivedevent('deviceready'); window.shouldrotatetoorientation = function(degrees) { return degrees !== 180; }; },
Comments
Post a Comment