BlogCodeSamples icon indicating copy to clipboard operation
BlogCodeSamples copied to clipboard

Text View scrolls to top if you try edit the bottom line.

Open swaterfall opened this issue 10 years ago • 2 comments

After adding the fix for #1 I noticed that if you tap the last line of the text view to bring up the keyboard it scrolls to the top. It only seems to happen when you tap the last line.

If you add this line of code to viewDidLoad:

    tableView.keyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag

Then add a bunch of text into the text box so its bigger than the screen, scroll up to dismiss the keyboard. Now if you tap the bottom row to start editing again it scrolls to the top.

Any ideas?

swaterfall avatar Apr 03 '15 13:04 swaterfall

Agreed, can reproduce. I have done some brief searching and haven't found any direct solutions.

May have to register for the UIKeyboardWillShowNotification notification and scroll/offset to have the selected area visible. Will do some more testing.

damienpontifex avatar Apr 04 '15 09:04 damienpontifex

@swaterfall long time, but I've updated the code to iOS 10 and using a UIStackView to layout the elements. Testing on my device this doesn't seem to be occurring now. Could you test with latest code and confirm?

damienpontifex avatar Aug 01 '16 02:08 damienpontifex