IOS modifies the rounded corner image. ios modifies the rounded corner image.
Style
Modifying the rounded corner is generally done by modifying the layer of the view.
/*** Circle ** @ param view */-(void) VC2RoundView :( UIView *) view {// you can enable one of them. layer. masksToBounds = YES; // view. clipsToBounds = YES; view. layer. cornerRadius = CGRectGetWidth (view. frame)/2 ;}
This is totally wrong ..........
Then, I used this method to check the information on the Internet and modify the rounded corner. I even downloaded other people's demos. However, what others do can be normally displayed, and my results won't work, check the differences from the beginning, and then find that they are all code display or do not use xib, so the fixed width and height
OK, the effect is achieved, but the fixed width and height are definitely not good for adaptive adaptation. Now the problem is that the view display constraints are correctly set but not loaded correctly, or is the modification of the rounded corner before the constraint adjustment ?, Retry
Add the code for modifying the rounded corner in viewdidload to viewdidappear.
It can be displayed normally, but when displayed, the square is directly displayed as a circle. Looking for the view declaration cycle method, we found a viewDidLayoutSubviews, and re-wrote it here.
OK. It IS DISPLAYED normally. And adaptive.
The problem with this feedback is that the modification to the view layer occurs before the constraint is adjusted. If the layer and the constraint are associated, You Need To debug it properly.
Otherwise, such problems may occur.