Meaning of red color in Android's Nine-patch drawables

天涯浪子 提交于 2019-11-28 23:08:01
Abhishek Sabbarwal

I believe this thread has some discussion on the same topic.

This has got something to do with setting layout bounds and I believe its not documented yet.

It's too support layout bounds.

See https://groups.google.com/d/msg/adt-dev/z_iLJWyDQdo/lf4sR6CRl2cJ for more info.

The red lines are how you define optical bounds on a nine-patch. This feature was officially added in Android 4.3 but to date, its still not available in the support library. Read more about them in the 4.3 release notes:

http://developer.android.com/about/versions/android-4.3.html#UI

If you are using optical bounds, you should take in account a little bug introduced with gradle 0.9.1 plug-in, For a work around First in this issue report: https://code.google.com/p/android/issues/detail?id=67376 In this you can see that using gradle plug-in 0.9.1 makes PNG crash on GB and it states that the work around is use 0.9.0 instead. But that not nice either, in the release notes of 0.9.1 the android team states that you should use the old PNG cruncher: http://tools.android.com/tech-docs/new-build-system

I have test both solutions and both are OK, i thing the second one is better, its your choice

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