I have an UIimageview but when the picture is taken, the image does not follow the size of UIimageview like this
Asked
Active
Viewed 37 times
3

Firuma
- 105
- 12
-
Have you tried changing the [`UIImageView`'s `contentMode`](https://stackoverflow.com/questions/14134035/how-to-manage-uiimageview-content-mode)? – MadProgrammer Nov 12 '18 at 02:20
-
I tried it, but the picture became irregular, I want the image to be cut according to the uiimageview, so that it looks good – Firuma Nov 12 '18 at 02:31
-
1Set `clipToBounds` to true. You could also use `aspectToFit` or `aspectToFill` depending on your needs – MadProgrammer Nov 12 '18 at 02:32
-
right, I tried and succeeded, thanks @MadProgrammer – Firuma Nov 12 '18 at 02:36
2 Answers
1
You should set the clipToBounds property of the UIImageView to true. This will solve your problem. Learn more at https://developer.apple.com/documentation/uikit/uiview/1622415-clipstobounds

sanjaykmwt
- 586
- 3
- 19