UIPageViewController inside of a UITableViewCell

自作多情 提交于 2019-12-08 19:46:17

问题


Hey I wanted to ask how do I implement a UIPageViewController inside of a UITableViewCell.

I have been reading around, but so far nothing seems to work for anyone trying.

I would appreciate some hints, no need for a full answer..

Thanks!.


回答1:


It is unclear exactly what you are attempting to do, but let me see if I can explain. You want to have a page view controller view inside a table view cell.

You will need to create a page view controller per cell, resize its view to the size of the cell's content view and add the view as a subview of the cell. You will then have to implement the page view controller's datasource and delegate methods inside the cell.

Something like:

self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
[self.pageViewController setDataSouce:self];
[self.pageViewController setDelegate:self];
[self.pageViewController.view setFrame:self.contentView.bounds];
self.contentView addSubview:self.pageViewController.view];

However, this is a peculiar design, which looks over-complicated.



来源:https://stackoverflow.com/questions/21711360/uipageviewcontroller-inside-of-a-uitableviewcell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!