How to use 9 patch images in android for different-2 densities(like mdpi,ldpi,hdpi).?

前端 未结 3 1986
情话喂你
情话喂你 2021-02-10 11:04

I am creating an android application in which I want multiple screen support.For these I have used 9 patch images.

But my question is this whether using 9 patch images w

3条回答
  •  情歌与酒
    2021-02-10 11:45

    From documentation: nine patch

    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. A NinePatch drawable is a standard PNG image that includes an extra 1-pixel-wide border. It must be saved with the extension .9.png, and saved into the res/drawable/ directory of your project.

    the answer is no. you nine patch will scale between different screen size

提交回复
热议问题