tvOS UIScrollView的滚动

tvOSUIScrollView的滚动跟iOS差别很大,UIScrollViewUITextView添加后并不能够进行滚动,需要进行一下设置:

textV.isUserInteractionEnabled = true
textV.panGestureRecognizer.allowedTouchTypes = [NSNumber(value: UITouch.TouchType.indirect.rawValue)]
        
scrollV.isUserInteractionEnabled = true
scrollV.contentSize = CGSize(width: UIScreen.main.bounds.width, height: 10000)
scrollV.panGestureRecognizer.allowedTouchTypes = [NSNumber(value: UITouch.TouchType.indirect.rawValue)]

你可能感兴趣的:(tvOS UIScrollView的滚动)