Xcode, UIscrollView and pagination

后端 未结 3 2021
温柔的废话
温柔的废话 2021-01-07 11:21

I am a beginner, I need to know how I can put in a UIScrollView multiple pages. These pages should contain interactive elements such as buttons,video and also text and image

3条回答
  •  旧巷少年郎
    2021-01-07 11:49

    You need to set 2 properties on your UIScrollView in order to have a smooth paging scroll.

    [scroller setPagingEnabled:YES];
    [scroller setContentSize:CGSizeMake(width, height)];
    /* width here would be your view's width times the amount of pages you want. */
    

提交回复
热议问题