使用SWRevealViewController和scrollview时遇到问题。 我按照下面的说明创建了侧边栏菜单(Swift 2.0& XCode 7): Sidebar Menu Tutorial Swift 2.0
您会看到以下图片:
SWRevealViewController conflict UIScrollView
如何处理它?任何帮助将不胜感激,谢谢。
以下是我的代码:
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var menuButton: UIBarButtonItem!
override func viewDidLoad() {
super.viewDidLoad()
//revealViewController().delegate = self
//self.scrollView.delegate = self
// Do any additional setup after loading the view.
let vc0 = FSMainSwipeVC(nibName: "FSMainSwipeVC", bundle: nil)
self.addChildViewController(vc0)
self.scrollView.addSubview(vc0.view)
vc0.didMoveToParentViewController(self)
//----
let vc1 = FSDetailSwipeVC(nibName: "FSDetailSwipeVC", bundle:nil)
var frame1 = vc1.view.frame
frame1.origin.x = self.view.frame.size.width
vc1.view.frame = frame1
self.addChildViewController(vc1)
self.scrollView.addSubview(vc1.view)
vc1.didMoveToParentViewController(self)
self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width * 2, self.view.frame.size.height - 66);
// Do any additional setup after loading the view.
if self.revealViewController() != nil {
menuButton.target = self.revealViewController()
menuButton.action = "revealToggle:"
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
}
}