在您的UIButton
,设置button.image.contentMode = UIViewContentModeScaleAspectFit
Control Click and Drag from Button to View Controller as IBOutlet
override func viewDidLoad(){
yourButtonOutletName.image.contentMode = .ScaleAspectFit
//
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.