Large Text Being Cut Off in UITextView That is Inside UIScrollView

后端 未结 17 1678
挽巷
挽巷 2020-11-29 02:03

I\'m having a serious problem that I just can\'t seem to fix and it\'s driving me insane for the last two days. I have searched far and wide and I can\'t find a solution, e

17条回答
  •  一整个雨季
    2020-11-29 02:53

    I am facing the same situation. I have to disable the UITextView's scrolling and doing that causes the last line is cliped. Here is my solution:

    //In the  UITextView subClass, override "gestureRecognizerShouldBegin" and let the scrolling of UITextView remain on.
    
    -(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
    {
        if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && gestureRecognizer.view == self){
            return NO;
        }
        return [super gestureRecognizerShouldBegin:gestureRecognizer];
    }
    

提交回复
热议问题