我的图像如何在 Swift 中占据所有按钮的大小
How can my image take all the button's size in Swift
StoryBoard
我只需要知道一张图片怎么能占据所有按钮的大小。我所有按钮的背景图片都很小
试试这个
ImageButton.imageView?.contentMode = .scaleAspectFill
或
ImageButton.imageView?.contentMode = .scaleToFill
StoryBoard
我只需要知道一张图片怎么能占据所有按钮的大小。我所有按钮的背景图片都很小
试试这个
ImageButton.imageView?.contentMode = .scaleAspectFill
或
ImageButton.imageView?.contentMode = .scaleToFill