uitableview - ios: ScrollView + Container + PageViewController + TableView -
i need implement screen image on top. , bellow have 2 sections tableview in each. that:
views hierarchy:
- scrollview
- containerview
- pageviewcontroller
- tableviewcontroller
- pageviewcontroller
- containerview
when change segment, update scrollview size:
var containerframe = containerview.frame let tableview = [songsuserinterface, singersuserinterface][segmentedcontrol.selectedsegmentindex].tableview! let tableviewcontentheight = tableview.contentsize.height let containerheight = max(tableviewcontentheight, maxcontainerheight) containerframe.size.height = containerheight containerview.frame = containerframe // set content height of scrollview according container var scrollframe = scrollview.frame scrollframe.size.height = containerframe.origin.y + containerheight // + height of other subviews below container scrollview.contentsize = cgsize(width: scrollview.contentsize.width, height: containerframe.origin.y + containerheight)
and works fine except 1 thing: paging swipe(default pageviewcontroller) not work in blue area:
red - screen size
green - entire content size
blue - content size hidden
Comments
Post a Comment