ionic framework - How to set iOS orientations in cordova config.xml for universal app? -
i have universal app , want portrait orientation iphone , landscape ipad. don't believe can do,
<preference name="orientation" value="landscape" />
because can't see how differentiate between phone , tablet. i've got in root:
... <platform name="ios"> <config-file target="foo-info.plist" platform="ios" parent="uisupportedinterfaceorientations"> <array> <string>uiinterfaceorientationportrait</string> <string>uiinterfaceorientationportraitupsidedown</string> </array> </config-file> <config-file target="foo-info.plist" platform="ios" parent="uisupportedinterfaceorientations~ipad"> <array> <string>uiinterfaceorientationlandscapeleft</string> <string>uiinterfaceorientationlandscaperight</string> </array> </config-file> ... </platform> ... - why doesn't update app's foo-info.plist? have tried
cordova build ios, have triedcordova preparecommands, neither update plist file. - when should these changes take effect? when add ios platform? when
cordova build ios? - i need work android phone , tablets if know how.
you don't have hardcode app name here:
<config-file platform="ios" target="*-info.plist" parent="uisupportedinterfaceorientations"> to working create hooks/after_prepare/011_update_platform_config.js file, take content here.
install npms:
npm install lodash elementtree plist ionic run, ionic build , ionic prepare commands should update project files.
for more information check out this topic
p.s.: should have strong reason use upside-down orientation on iphone otherwise it's pain users (hello ibooks).
Comments
Post a Comment