my initial problems with UIScrollView now appear to be related to autolayout

前端 未结 1 666
再見小時候
再見小時候 2021-01-27 10:54

For my first challenge using UIScrollView I modified this example to make UIScrollView display not just another background colour but another UIV

相关标签:
1条回答
  • 2021-01-27 11:01

    The centre point of the lable on each frame must be offset by the origin of the content view (as Baglan pointed out). I've modified the following line of code accordingly.

    lables[Int(index)].center = CGPoint(x: (view.frame.midX + frame.origin.x), y: view.frame.midY)
    
    0 讨论(0)
提交回复
热议问题