iOS: Autolayout causing UIScrollView to not scroll

后端 未结 3 742
抹茶落季
抹茶落季 2021-01-04 08:18

I have set up a UIScrollView with which I want to display 12 images (only 8 fit on screen) laid out horizontally. In the following image you can see the problem

3条回答
  •  盖世英雄少女心
    2021-01-04 09:12

    Try to set your scrollView's Content size int "viewDidLayoutSubviews" method with keeping the autolayouts set.

    -(void)viewDidLayoutSubviews
    {
      [self.itemList setContentSize:CGSizeMake(required_width, required_height)];
    }
    

提交回复
热议问题