Today I suddenly learned some basic UI properties before learning
is when we set the corner of the view
Let's say the following code
UIButton *button = [[UIButton alloc] Initwithframe:cgrectmake (Ten, Ten, ())]; Button.layer.masksToBounds = YES; Button.layer.cornerRadius = 30;
This sets the Fillet property for the button
I used to write that layer is the level of the drawing of view.
Today I suddenly realized why write masktobounds this property is set to Yes
So, first of all, let's say that each control that inherits the view has a layer, which is a layer, which is actually a mask for the view. All the drawing is a layer equivalent to a painting of the paint and view is the canvas to show the layer of the container or view
And then today I learned that mask is the thing that we can set the mask layer to cover the layer, which seems a little abstract.
Is the mask layer when transparent, the layer will normally display the drawing style
When the mask layer is not transparent when placed above the layer of the mask layer is what shape layer will show what shape layer coating content
In fact, it can be understood as mask equivalent to clipping or lens shape, etc.
Remove the layer below the extra mask area with an opaque mask
So let's say the button above is set to Masktobounds==yes I understand that the mask layer has been set and given its own scope
The mask layer is then filtered to filter out the extra portions of the layer.
By setting the properties of the layer to set the fillet of the method to cut off the extra part so this time to get a circular button view is actually the layer is drawn as a circle through the mask cut filter ...
The above is my own for the experience of the summary if there is an opinion welcome to communicate
Mask Layer---iOS developing the nature of the layer of the View fillet attribute