Closed hpique closed 10 years ago
Scratch that. I found a couple of bugs. Will give it a further look in a couple of hours.
After much testing it appears the bugs were not introduced by this pull request. I'll report them as separate issues.
In any case, without this commit scrollToVisibleCaretAnimated:
doesn't scroll to the right position when the textView has textContainerInset
values.
Are you setting the textContainerInset
as well? I'm not even setting them, and - haven't tried yet - but i guess that PR would break my implementation then since textContainerInset
is 0 and containerInset
is non-nil.
I need to set the textContainerInset
to account for a custom translucent toolbar at the bottom, and add a nice margin on top. Couldn't figure out how to do it without it.
I should add that you're (unintentionally) using textContainerInset
as well in your demo project, as it has default values of {8, 0, 8, 0}
. Without accounting for it, the offset is slightly off.
Without this, the scroll is sometimes a little off. I’m not 100% this is correct, as I don’t fully understand the relation between
contentInset
andtextContainerInset
. That said, my app works much better with this change.