iPad Pro Cordova App Scaling

谁都会走 提交于 2019-12-07 23:22:40

问题


How do you make the iPad Pro app not scale when using Cordova? I figured out a workaround setting initial, minimum, and max scale to .75, but it still appears pixelated. When I look at the status bar on the home screen vs in the app, the app status bar is significantly larger, so I definitely know it's scaling up.


回答1:


I figured that, since I couldn't find an answer to this on StackOverflow, I'd post my solution to the issue. I got assistance for this answer from http://www.cordovacircus.com/articles/ipad-pro-and-cordova.

Steps:
1. Create a storyboard in your Xcode project. To open this project, go to {app root}/platforms/ios/, and open up the .xcodeproj file.
2. Drag a view controller into the storyboard. This will operate as your splash screen, so you can add anything you'd like. I only needed to get the scaling fixed so I left mine blank.
3. Go to general settings by clicking the root of the project inside of Xcode. Scroll down to App Icons and Launch Images, and change the Launch Screen File to the storyboard file you just created.

Voila! The app should now launch in fullscreen with no scaling.




回答2:


Another way I found to do this was to make sure you have the correct splash screen image sizes loaded for this larger device as mentioned here: iPad Pro incorrect app size

  1. install the Cordova splash screen plugin
  2. add the following to your config file

    <splash src="res/screen/ios/Default@2x~universal~anyany.png" /> <splash src="res/screen/ios/Default@2x~universal~comany.png" /> <splash src="res/screen/ios/Default@2x~universal~comcom.png" /> <splash src="res/screen/ios/Default@3x~universal~anyany.png" /> <splash src="res/screen/ios/Default@3x~universal~anycom.png" /> <splash src="res/screen/ios/Default@3x~universal~comany.png" />

Then make those images the following sizes

  • Default@2x~universal~anyany.png - 2732x2732
  • Default@2x~universal~comany.png - 1278x2732
  • Default@2x~universal~comcom.png - 1334x750
  • Default@3x~universal~anyany.png - 2208x2208
  • Default@3x~universal~anycom.png - 2208x1242
  • Default@3x~universal~comany.png - 1242x2208

Then add those image resource png files into projectRoot/res/screen/ios folder



来源:https://stackoverflow.com/questions/35607620/ipad-pro-cordova-app-scaling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!