Using Framelayout to implement a mask layer, the basic principle is to dynamically load a layout
The first is the layout file
Activity_validate_phone.xml?
The root layout uses framlayout
And then the activity.
? private ImageView Infooperatingiv;
Private ImageView ImageView;
Private Framelayout layout;
Then add layout to the Listener function of the button
Note the time of ImageView Declaration;
Use Layout.removeview (ImageView) when clear;
?
? Center/center is centered on the original size of the image, and when the picture is longer/wider than the length/width of the view, the center portion of the image is displayed
Center_crop/centercrop Proportionally enlarges the size of the image so that the image is long (wide) equal to or greater than the length (width) of the view
center_inside/centerinside Displays the contents of the picture in full, by scaling it down or the original size to make the picture long/wide equal to or less than the length/width of the view
fit_center/fitcenter Enlarge/Shrink the picture to the width of the view, centered on the display
fit_end/fitend Zoom in/out to the width of the view, displayed in the lower part of the view
fit_start/fitstart Enlarge/Shrink the image to the width of the view, displayed in the upper part of the view
Fit_xy/fitxy The picture is not scaled up/down to the view size display
The Matrix/matrix is drawn with a matrix and is displayed by zooming in and out of the image.
Using Framelayout to implement masking layers