当我转动它时,如何在iPhone中更改我的应用程序屏幕方向?
在config.xml中我有:
<preference name="OrIEntation" value="default" />
我能找到的唯一解决方案是在Cordova代码中的MainVIEwController.m中更改方法shouldautorotatetoInterfaceOrIEntation:
- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)interfaceOrIEntation{ // Return YES for supported orIEntations-- return [super shouldautorotatetoInterfaceOrIEntation:interfaceOrIEntation];++ return true;}
但这对我来说似乎是一个丑陋的解决方案,我真的很想找到正常的做法.
理想情况下,除了portraitUpsIDeDown之外,iPad和iPhone的所有方向都是好的,但我不知道我是否被允许梦想它.
还有其他人与iPhone和Cordova有类似的问题吗?我一直在谷歌搜索几天,除了这个黑客在cordova代码中找不到任何东西.
@R_502_6120@ 在深入寻找解决方案之后,我不幸得出结论,这是一个Cordova问题.该<preference name="OrIEntation" value="default" />
代码应该实际更改iOS配置文件(/platform/ios/~app_name〜/〜app_name〜.pList)中的平台UISupportedInterfaceOrIEntations键,以包含以下值:
>“UIInterfaceOrIEntationLandscapeleft”;
>“UIInterfaceOrIEntationLandscapeRight”;
>“UIInterfaceOrIEntationPortrait”; (我认为)
>“UIInterfaceOrIEntationPortraitUpsIDeDown”
不幸的是,更改config.xml文件不会改变pList文件,这很烦人.希望这将很快得到排序,从在线发现的线程判断,很多人浪费时间寻找解决方案.
我发现最简单的解决方案是手动更改~app_name~.pList文件以包含上面的值.我一直在Xcode中这样做,这很容易做到.
希望这可以帮助.如果有更好的解决方案或Cordova修复此疏忽请告诉我.
总结以上是内存溢出为你收集整理的ios – 在cordova 3.5.0中iPhone屏幕方向没有变化全部内容,希望文章能够帮你解决ios – 在cordova 3.5.0中iPhone屏幕方向没有变化所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)