Multi Device Hybrid Apps - support for xxhdpi and xxxhdpi densities on Android

柔情痞子 提交于 2019-12-10 10:55:45

问题


I'm using Visual Studio 2013 with the Multi-Device Hybrid Apps CTP 2.0. In the project template, there are several placeholder splashscreens and icons for Android: ldpi, mdpi, hdpi and xhdpi densities. How can I get support for xxhdpi and xxxhdpi densities? I tried following:

  1. Added files to res/icons/android (icon-144-xxhdpi.png) and res/screens/android (screen-xxhdpi.png)
  2. Added icon specification to config.xml according to Cordova docs

The xxhdpi images are not present in the APK file after a build.


回答1:


Currently Visual Studio does not support xxhdpi or xxxhdpi and therefore xxhdpi.png images does make it to package (.apk). VS CPT2.0 supports below listed resolution and you can see the complete list across different platforms here http://msdn.microsoft.com/en-us/library/dn757053.aspx#VisualAssets

Workaround to include xxhdpi or xxxhdpi resources to package:

  1. Create the Multi-Device Hybrid Apps project or open any existing project.
  2. Build the project
  3. Go to bld\Debug\platforms\android\res
  4. Add folder for xxhdpi or xxxhdpi res like

  1. Build the project. Do not re-build.

Now all the resources present under bld\Debug\platforms\android\res will be add to package (*.apk)

Supported icon and screen resources in Visual Studio Multi-Device Hybrid Apps CTP 2.0:

  • icon-36-ldpi.png
  • icon-48-mdpi.png
  • icon-72-hdpi.png
  • icon-96-xhdpi.png
  • icon-96-xhdpi.png

  • screen-xhdpi-landscape.png

  • screen-hdpi-landscape.png
  • screen-mdpi-landscape.png
  • screen-ldpi-landscape.png
  • screen-xhdpi-portrait.png
  • screen-hdpi-portrait.png
  • screen-mdpi-portrait.png
  • screen-ldpi-portrait.png


来源:https://stackoverflow.com/questions/25767545/multi-device-hybrid-apps-support-for-xxhdpi-and-xxxhdpi-densities-on-android

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