我有一个使用pageviewcontroller的非常简单的应用程序。使用手势可以正常工作,但如何使用按钮跳转到下一个或上一个索引/页面呢?
谢谢大家
祝好
Chris
我有一个使用pageviewcontroller的非常简单的应用程序。使用手势可以正常工作,但如何使用按钮跳转到下一个或上一个索引/页面呢?
谢谢大家
祝好
Chris
你可以初始化新的视图控制器类,并像这样将当前视图更改为新视图:
///In viewDidLoad
let myFirstButton = UIButton()
myFirstButton.addTarget(self, action: "pressed:", forControlEvents: .TouchUpInside)
self.view.addSubview(myFirstButton)
//////
func pressed(sender:UIButton!) {
let vc = YourNewViewController() //change this to your class name
self.presentViewController(vc, animated: true, completion: nil)
}