开发者

How to trouble shoot 9-patch image problem in android

开发者 https://www.devze.com 2023-01-02 16:40 出处:网络
I have an ImageView 开发者_运维技巧in my layout xml file. I set the width to wrap_content and height to fill_parent.In hierarchy viewer, the width is 2 px and height is 120 px. But when I see it on de

I have an ImageView 开发者_运维技巧in my layout xml file. I set the width to wrap_content and height to fill_parent. In hierarchy viewer, the width is 2 px and height is 120 px. But when I see it on device, my 9-patch image for the image view does not stretch to 120 px. Can you please tell me how can I trouble shoot this 9 patch image does not stretch error?

Thank you.


You have to set android:scaleType in order for the ImageView to resize the 9-patch. Normally you will want to set it to fitXY.

0

精彩评论

暂无评论...
验证码 换一张
取 消