-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TPKeyboardAvoiding with fullscreen UITextView doesn't work correctly #58
Comments
I have the same issue with my project. Please help! |
I also have an issue with textview support. After some textfield I have a textview. It appears that doing multiple return line in the textview result in a bad state where the scrolling view became shorter, and i cannot reach the end of my table view. Even if i try to disable return line in my textview the problem still exist. |
I've come across what seems like a similar problem with a full view UITextView set up with standard hierarchy of ViewController -> UIScrollView (TPKeyboardAvoidingScrollView) -> UITextView. I did not see the method that is able to recognize in what area of a UITextView the user is interacting, but I didn't look at all the classes. Has anyone been able to resolve this issue since it was opened more than a year ago? |
I have come across this issue as well, but it turns out be a stupid mistake. I have used a wrong class for my scrollView. There are a few available classes from this repo:
It is easy to mis-type the class name in storyboard, and the compiler will not complain about it. So please double check it. |
As haojianzong mentions double check the class for the scrollview. Adding a "container" view in the case of a ScrollView with constraints set to the superview is also a good practice as follows: ViewController -> UIScrollView (TPKeyboardAvoidingScrollView) -> UIView (container for UI elements) -> UITextView. If you want vertical scrolling set the height constraint to be '>='. |
I have got this working nicely, including respecting safe areas, so wanted to share some code to help others. This uses the same structure as mentioned by @jungchris above. Firstly make sure to set the following properties:
The set up the constraints as follows:
|
Hi,
I've created a simple project with a main view that contains:
UIView -> TPKeyboardAvoiding -> UITextView
When you write in the UITextView the cursor goes below the keyboard like I'm using a simple UIScrollView.
You can download it at https://github.com/gcastaldi/AvoidKbHelloWorld.git.
Thanks.
Giannandrea
The text was updated successfully, but these errors were encountered: