Creating & Using 9-patch images in Android

前端 未结 8 2124
走了就别回头了
走了就别回头了 2020-11-30 00:39

I recently heard about 9-patch images. I know its 9 tiled and is stretchable. I\'d like to know more about it.

  • How can I create a 9-patch image?

    Is th

8条回答
  •  一个人的身影
    2020-11-30 01:09

    How can I create a 9-patch image? Is there any tool? Can I create it from AndroidSDK or code?

    When you search a major search engine for android 9-patch tool, the very first hit is for the Android developer documentation page on the draw9patch tool.

    Main Advantages of 9-patch over regular png? (is it stretchable dynamically/ automatically according to screen?)

    The Android developer documentation contains other pages that describe nine-patch PNG files. This documentation includes passages like:

    A NinePatchDrawable graphic is a stretchable bitmap image, which Android will automatically resize to accommodate the contents of the View in which you have placed it as the background. An example use of a NinePatch is the backgrounds used by standard Android buttons — buttons must stretch to accommodate strings of various lengths.

提交回复
热议问题