我有一個帶有四個選項卡的UIPageViewController。三張桌子和一個webview。問題是垂直滾動不起作用。我如何使用swift解決這個問題?UIPageViewController:表垂直滾動不起作用
這是我的代碼:
func createTxtPageViewController() {
let pageController = self.storyboard!.instantiateViewControllerWithIdentifier("pagetxtController") as! UIPageViewController
pageController.dataSource = self
pageController.delegate = self
if texts.count > 0 {
let firstController = getItemTxtController(0)!
let startingViewControllers = [firstController]
pageController.setViewControllers(startingViewControllers, direction: UIPageViewControllerNavigationDirection.Forward, animated: false, completion: nil)
}
pageTxtViewController = pageController
pageTxtViewController?.view.frame = CGRectMake(10, 173, self.rightView.frame.size.width - 20, self.rightView.frame.size.height - 183)
addChildViewController(pageTxtViewController!)
self.rightView.addSubview(pageTxtViewController!.view)
pageTxtViewController!.didMoveToParentViewController(self)
}
嘗試更改順序添加容器意見'self.rightView.addSubview(pageTxtViewController!.view)''然後addChildViewController(pageTxtViewController!)' –
@KhalidAfridi這不行 – breno
你已經在刷卡功能的pageViewController? –