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)
why on earth red square not @ top left corner of scroll view expected...? how can make happen?
Comments
Post a Comment