T
T
tiger_132021-05-06 19:14:02
Swift
tiger_13, 2021-05-06 19:14:02

How to scroll uitextview so nsrange is centered?

Hello!
I use the UITextView system function: This makes the range really visible, only in random places (top/bottom of the screen). How can I make scrollRangeToVisible display the given range clearly in the center of the screen? PS Or am I defining NSRange incorrectly and by default it brings everything to the middle? Thank you in advance for your help!
func scrollRangeToVisible(_ range: NSRange)



Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
briahas, 2021-05-07
@briahas

Perhaps you either have a range greater than the size of the UI element, or the keyboard is removed from the screen after you have executed scrollRangeToVisible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question