How can I get 9-patch to center my image on a cordova launch screen

点点圈 提交于 2019-12-25 08:04:15

问题


I manually created a 9-patch .png as shown below / indicated here:

  • Stretch areas
    • Top: Dot all the way to the left, dot all the way to the right
    • Left: Dot all the way at the top, dot all the way at the bottom
  • Content area
    • Bottom: Line entire length of image
    • Right: Line the entire height of image

I expect it to render the image in the center both vertically and horizontally, however it's rendering too low vertically (and I'm not sure horizontally).

I may be misunderstanding the 9-patch rendering algorithm, like how it decides how much to stretch each area on a given axis. Or how Cordova tags the 9-patch for my Meteor application. Anything insights are welcome!

My 9-patch

Rendering on Nexus 5

来源:https://stackoverflow.com/questions/38163429/how-can-i-get-9-patch-to-center-my-image-on-a-cordova-launch-screen

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