Animating a height-change for a UITextField makes its text animate from a wrong position
Originator: | avedesk | ||
Number: | rdar://37274680 | Date Originated: | 06-Feb-2018 05:14 PM |
Status: | Open | Resolved: | |
Product: | iOS + SDK | Product Version: | 11.2.5 |
Classification: | Other Bug | Reproducible: | Always |
Summary: When changing the height of a UITextField inside an animation block, the text of the textfield will animate from the wrong position. In the attached screen recording you can see the gray textfield being resized to a larger height. The text animation starts from a wrong position to animate to the correct position. Steps to Reproduce: 1. Have a UITextField with text 2. Change the textfields height inside an animation block Expected Results: 1. The text of the animation textfield animates correctly along the height-change-animation Actual Results: 2. The text of the animation suddenly starts at a wrong position to animate to the correct position Version: 11.2.5 Notes: PLEASE DO NOT ASK FOR A SYSDIAGNOSE, THIS IS A UIKIT BUG NOT DEPENDING ON A DEVICE
Comments
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!
The problem seems to be caused by UITextContentView being a tiled layer which gets recreated if a height change is more than the tile size (128 it seems). The content of the tiles is drawn where it should be after animation, so during the animation it shows on the wrong place. A fix for this would be to offset the UITextContentView by the difference in height when a bounds change is animated, essentially making sure that the text always stays vertically in the center of the textfield.