ios,swift
[ios]swift uiimageview contentmode not working , translatesAutoresizingMaskIntoConstraints 연관 이슈해결방법
thdeodls85
2020. 4. 14. 14:20
[ios]swift uiimageview contentmode not working , translatesAutoresizingMaskIntoConstraints 연관 이슈해결방법
contentmode = .scaleAspectFill
viewDidLoad 에서 설정할려고 했다. 그런데~~~
self.Image.translatesAutoresizingMaskIntoConstraints = false
적용을 하려고 하니 초기화 되버리는 이슈가 있다..
자 그러면 어떻게 해야 할까??
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
self.Image.contentMode = .scaleAspectFill
}
이러면 된다~