ios - why setting "translatesAutoresizingMaskIntoConstraints" to false before setting imageView, will show no images? -


i new ios, learning constraints in scroll view.

i have following code (type1):

wallpaper.view.translateautoresizingmaskintoconstraints = false wallpaper.wallpaperimage = uiimage(named: backgroundimagename) 

if build app, screen shows white screen. have checked nil possibility of image it's not.

then swapped code this(type2):

wallpaper.wallpaperimage = uiimage(named: backgroundimagename) wallpaper.view.translateautoresizingmaskintoconstraints = false 

then, image show up. question why affect imageview? have seen several codes using type1 , work normally.

thank reading!

i think because intrinsic content size of imageview while image = nil cgsize.zero if define width , height constraint explicitly different result, when set image before intrinsic content size of uiimageview have value defined uiimage contained in uiimageview


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -