Unscrollable UITextView contentSize bug

Originator:an00na
Number:rdar://20694945 Date Originated:24-Apr-2015 07:10 PM
Status:Behaves correctly Resolved:
Product:iOS SDK Product Version:8.3
Classification:Serious Bug Reproducible:Always
 
Summary:
If UITextView's scrollEnabled is set to NO, its contentSize does no update properly along with its text changes.

Steps to Reproduce:
1. Run sample app.
2. Insert text, check the console log to see that contentSize is NOT increasing.
3. Delete some text to the extent that the text left is shorter than the original text, check the console log to see that contentSize is NOT decreasing.

Sample code: http://cl.ly/1w1L35330Y1S

Expected Results:
contentSize should update according to text, whether scrollEnabled is YES or NO.

Actual Results:
contentSize does not update according to text when scrollEnabled is NO.

Comments

Apple Developer Relations05-May-2015 10:37 AM

This issue behaves as intended based on the following:

It’s expected that contentSize matches the size of the view when scrolling is off.

If you want to find out how tall the text is at the current width, you can use e.g.

[textView sizeThatFits:CGSizeMake(textView.bounds.width, FLT_MAX)];

Please update your bug report to let us know if this is still an issue for you.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!