I have a UIImageView and use autostart to add height and width restrictions (and others). There are no conflicting restrictions or warnings. I request an image from the database and set the image of the image for this image. However, the image appears with a much higher height than I indicated through the restrictions. How to fix it?
This line should solve your problem:
yourImageView.clipsToBounds = true
You can do this on the Storyboard by checking the "Moving Clips" of your UIImageView.
1
YourImageView.contentMode=UIViewContentModeScaleAspectFit;
, - contentMode, , , .
2. , []
If you get the image from the server, you should resize the image to fit your imageView size ... its best practice.
Source: https://habr.com/ru/post/1617826/More articles:Easy way to enable / disable assert statements in node.js - javascriptХотите удалить существующий документ из значений папки и базы данных из таблицы, используя транзакцию в запросе на спящий режим - javaParallel Transitional Reduction - c #Google Fonts in React Native - fontsHow to add snow cover effect in UIView - iosWhat happens when RDMA works on a mmaped region? - c ++Как игнорировать нежелательные столбцы в CSV с помощью FlatFileItemReader в пакете spring - javaApache commons csv skip lines - javaIs there a way to explicitly write an elixir function for tail optimization? - optimizationDownloading HTTPS pages from urllib, error: 14077438: SSL routines: SSL23_GET_SERVER_HELLO: tlsv1 internal warning error - pythonAll Articles