Large Text Being Cut Off in UITextView That is Inside UIScrollView

后端 未结 17 1632
挽巷
挽巷 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:56

    This happens all the way, from in Interface Builder too.

    When text view selected, in Utilities Inspector uncheck the option Shows Vertical Indicator. The cropped text appears now.

    0 讨论(0)
  • 2020-11-29 02:57

    This issue has existed since iOS 7 and is still present in iOS 12.

    However, I wasn't able to keep the normal scrolling behaviour by setting scrollEnabled = NO before the resize, as @igz recommended. Instead I switched scrolling on and off after the resize

    // Resize text view here
    
    textView.scrollEnabled = NO;
    textView.scrollEnabled = YES;
    

    This forced the cut off text to render correctly.

    0 讨论(0)
  • 2020-11-29 02:58

    Thanks everyone for your help. This is ultimately what ended up working for me in iOS7.

    I had to disable auto layout for this particular xib.

    Then did the following:

    [textView setScrollEnabled:YES];
    [textView setText:text];
    [textView sizeToFit];
    [textView setScrollEnabled:NO];
    
    0 讨论(0)
  • 2020-11-29 02:58

    I had a similar issue, wherein long text was getting cut off after a resize of the text view. Turning off scrollingEnabled before the resize seemed to fix it. Sure seems like an IOS 7 bug.

    0 讨论(0)
  • 2020-11-29 02:58

    This worked for me:

    textView.scrollEnabled = NO;
    
    //resize here
    
    textView.scrollEnabled=YES;
    
    0 讨论(0)
  • 2020-11-29 02:59

    We had the same problem, except the left half or right half of the UITextView was getting cut off. Happened on both iOS 7 and iOS 6, on a variety of phones. Calling:

    myTextView.scrollEnabled = NO;
    

    in viewWillAppear worked around the problem.

    0 讨论(0)
提交回复
热议问题