开发者

How to design ImageViews that stretch according to the screen-size

开发者 https://www.devze.com 2023-01-24 03:38 出处:网络
I have a requirement where few of my image views form border areas of an application, and the application will be running on many screen size开发者_运维技巧s.

I have a requirement where few of my image views form border areas of an application, and the application will be running on many screen size开发者_运维技巧s. I'll be creating a uniform image for the smallest size possible, which can be repeated as many times as needed, and still presents the same image. I want the image view to replicate the image contained whenever it is increased.

Is anything like this possible?

I tried 9-patch images, but I couldn't find nice articles on it which could explain how to create useful images with it which could suit my need.


I think you have to write a custom view to do this. Overide onDraw method in it to copy your bitmap as many times as needed.


Get the width and height of the device dynamically and set the imageview width and height in program.

0

精彩评论

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