UITextView
in TVOS
not scrolling, I can see its contentSize
is great then its bounds
, I can confirm that scrollEnabled = YES
, userInteraction = YES
and it is current focused view.
UITextView
in TVOS
not scrolling, I can see its contentSize
is great then its bounds
, I can confirm that scrollEnabled = YES
, userInteraction = YES
and it is current focused view.
If you're going to be allowing a user to scroll a text view (or any scroll view) then you should try to avoid putting focusable controls in the direction of the scrolling. For instance if you're scrolling vertically avoid any controls above or below the scroll view otherwise focus might move to the elements while the user is trying to scroll.
Thank you for your help, we got the same problem, solved with this solution 🙂
There's got to be some way around this. If you have a scrolling detail view, the logical place for buttons is above or below, because, with labels, they are inherently horizontal animals.
In our case, the textView with buttons below is is a detail of a splitView with a table as masterView. A horizontal swipe should select one of the lower right buttons. The textView should not be focused. An up/down swipe should scroll the textView. So far, we have not been able to get this to work. It should be possible, because that is exactly what the "Descriptive Alert" view does in the TVML examples. Lower buttons retain focus and can be selected by horizontal swipes. Verticle swipes scroll the textView.
Which solution?
Thanks man, you saved my day!
I tried different combination of those answers below and found one did work for me.
yourtextView.isSelectable = false
yourtextView.isUserInteractionEnabled = true
yourtextView.panGestureRecognizer.allowedTouchTypes = [NSNumber(value:UITouchType.indirect.rawValue)]
view.addSubview(yourtextView)
I did't override preferredFocusEnvironments and didUpdateFocus function. I think the key is set "yourtextView.isUserInteractionEnabled = true"