简体   繁体   中英

image background like a frame using android drawable xml

I need to create an imageview with background drawable like a frame but not getting the required design.

I'm getting these images

具有centercrop scaletype的图像

与centerfit的iimage

But the required designs are

在此输入图像描述

In your layout, set the background to the required colour.

android:background="#FFF9C4"

Then add the ImageView inside the layout and add padding on Left, Right, Top and Bottom of size as per requirement.

You can explore shape too, using shape you can control the corners as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM