Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```swift
- button.imageView?.contentMode = .scaleAspectFit
- button.contentHorizontalAlignment = .fill
- button.contentVerticalAlignment = .fill
- ```
- コードを書くと実行時にAspect Fitになる。
- Interface Builder上では正しく表示されない。
- IBDesignableで指定できるボタンを作ると便利かも?
- `contentHorizontalAlignment` と `contentVerticalAlignment` は `UIControl` の機能らしいけど、これ `UIButton` 以外だとどんな動きをするのだろう🧐
Add Comment
Please, Sign In to add comment