A button will take the size of the image by default. but since SF-Symbols are vectors, they can be scaled to any size. Each symbol has a few predefined sizes that you can choose:
Also, you can set your own size in the code:
let config = UIImage.SymbolConfiguration(pointSize: 160, weight: .bold, scale: .large)
let largeChevronImage = UIImage(systemName: "chevron.right.circle.fill", withConfiguration: config)
button.setImage(largeChevronImage, for: .normal)
Some images and SF-Symbols have some paddings around their content. You can control the size of the padding by setting the ContentEdgeInsets
You can clip the bounds to hide the out of frame content
All SF-Symbols have same size
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.