I have a strange issue , I have a page app in which one page I had used a UITextView
, but when I tap on the UITextView
it moves to the next page, can't write anything on it.
There is no issue when I use UIPageViewControllerTransitionStylePageCurl
. The only issue is with UIPageViewControllerTransitionStyleScroll
. Anyone know the solution? please help me
I ran into the same issue myself, and it appears that it's a consequence of some default behavior that occurs whenever a UITextField or UITextView becomes first responder inside a UIScrollView.
The solution to prevent your UITextView from scrolling the UIPageViewController is to first embed it into a UIScrollView instead of directly into a page's main view.
This works because when the UITextView becomes first responder it will search for the earliest superview in the view hierarchy that is of type UIScrollView, and it will scroll that scrollview to accommodate for the keyboard covering the screen. If you don't wrap the UITextView inside a UIScrollView, your UIPageViewController's internal UIScrollView will be chosen and scrolled, producing undesired behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With