ios - Understanding subviews frame in UIScrollView -


i have following code i'm trying dynamically add subviews uiscrollview.. however, result not i've expected. here is:

let red = uiview(frame: cgrect(x: 0, y: 0, width: 20, height: 20)) red.backgroundcolor = uicolor.red let blue = uiscrollview(frame: cgrect(x: 0, y: 100, width: uiscreen.main.bounds.width, height: 200)) blue.backgroundcolor = uicolor.blue blue.addsubview(red) view.addsubview(blue) 

enter image description here

why on earth red square not @ top left corner of scroll view expected...? how can make happen?


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -