Android image rounded corner effect,
Generally, you can use Java to add rounded corners to images, but you can also use pure XML + Nice-Patch images for faster processing. this method is recommended if the background is solid.
The principle is to use frameLayout to add a hidden image to the image to achieve the rounded corner effect.
Background image:
It is transparent in the middle. You can use ps to draw a rectangle with rounded corners, and then select and fill the corner color.
Layout file: 01
02 <framelayout <p = ""> </framelayout <>
03 android: layout_width = "48dp"
04 android: layout_height = "48dp"
05>
06 <imageview <p = "">
07 android: id = "@ + id/profile_image"
08; android: layout_width = "fill_parent"
09 android: layout_height = "fill_parent"
10/>
11
12 <imageview <p = "">
13 android: background = "@ drawable/images_border_radius"
14; android: layout_width = "fill_parent"
15 android: layout_height = "fill_parent"
16/>
17
The first ImageView is the target image, and the first ImageView is the shadow layer.