It is difficult for me to make images on the UISegmentedControl, maintaining their aspect ratio, and not scaling from all sides. Here's what it looks like:
Images are 100X100 (with the exception of nr 6 will soon replace), and I want them to maintain aspect ratio.
I tried:
self.segment.contentMode = .ScaleAspectFit //and: self.segment.contentMode = UIViewContentMode.Center
Is there a way to target UIImageView in a segment ... that way I can set contentMode..right? Or is there a different approach?
thank
, contentMode ScaleAspectFit, :
yourSegmentedControl.setImage(yourImage.resizableImage(withCapInsets: .init(top: 0, left: 10, bottom: 0, right: 10), resizingMode: .stretch), forSegmentAt: 0)
"", "", "" "", . , , !
Source: https://habr.com/ru/post/1651177/More articles:Outputting empty lines between grep results when working with -C (or -B / -A) - linuxConvert int to time (weird values) - typesBigQuery Instance - "Internal Error" - google-bigquerycheck json against schema in javascript - jsonto respond to native sampling without sending body content - react-nativeCommunicate with a Docker host from a Docker container - dockerGulpfile not found - node.jsDesigning physical bodies other than circles - swiftIon events 2 ionChange are triggered before the event ends - ionic2Добавить купон в электронную почту для обработки, только если клиент не использовал один - phpAll Articles