Scrolling in UIScrollView with tvOS

I am stuck in scrolling content inside a UIScrollView in my tvOS application.

I have a scrollView with height = 400 and width = 400. Inside this scrollview, I have a scrollable UITextView with height = 800 and width = 400. So I want to scroll this text.

But my scroll view doesn't scroll, I don't see any scroll indicators, and also scrollView has the value Focused = false. How can I solve this problem?

ps update I created a separate ViewController (image below). It has a black ScrollView and a white view with a large height with a mark in the middle. ScrollView has a fixed width and height, and for some reason there is no scrolling! I did not even connect any separate class - I just created it from Interface Builder.

enter image description here

+4
source share
3 answers

I think you can use

func gestureRecognizer (_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool 

to judge and scroll through the view

In accordance with the point of view that you touch to do something to intercept

0
source

There is some way to fix your problem.

  • Please check your scrollview in the storyboard, is your scroll or vertical indicator checked?
  • U can make your scrollable text if you just want to scroll the contents of textview
  • There is a problem in your restriction, you need to clear the addition of height, vertical space on top, vertical space down from your text box to your scroll.

Hope these tips help you.

0

, , scrollview, contentize (400, 800), probaly xib

0

Source: https://habr.com/ru/post/1683757/


All Articles