How to embed a UITableView in a UIScrollview

后端 未结 6 646
借酒劲吻你
借酒劲吻你 2020-12-05 05:47

How can I do the following in a UIViewController (containing a tableview as a subview)

I initially have a UIViewController showing a preview section (UIView)

6条回答
  •  暖寄归人
    2020-12-05 06:14

    scroll.contentSize = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height);
    

    It can not scroll because contentSize is not large enough. You need to increase the length to total length of your content that are on top of the scrollView.

提交回复
热议问题