Utility of android nine patch

后端 未结 8 1380
鱼传尺愫
鱼传尺愫 2020-12-06 07:57

I would like to know why do we use nine-patch ? I know is to shrink or stretch images but if I want to resize an image can\'t we just do it on a dedicated image editor like

8条回答
  •  温柔的废话
    2020-12-06 08:21

    Nine-patch is to do the stretching on the run time... If you use an Button with a custom background for example and say width-> fill_parent... there is a lot of different devices out there with different resolution how are you going to prepare images for all of them... you give a nine patch and its stretch on the run.

提交回复
热议问题