开发者

UITextView changing width screws up word wrap

开发者 https://www.devze.com 2023-02-03 14:47 出处:网络
While writing a UITextView control, I realized that if I change the width (via setFrame) of the view on scale gesture, the word wrap gets screwed up. It becomes prominent on rescaling multiple times.

While writing a UITextView control, I realized that if I change the width (via setFrame) of the view on scale gesture, the word wrap gets screwed up. It becomes prominent on rescaling multiple times.

By screwing up, I mean that the text starts wrapping from a smaller frame/rectangle than the current width of the textview. This is what I am doing on scale gesture:

[textview setFrame:CGRectMake(textview.frame.origin.x, textview.frame.origin.y, textview.frame.size.width * [gestureRecognizer scale], textview.frame.size.h开发者_高级运维eight )];

Also, if it helps to debug, I have subclassed the UITextView and set the canBecomeFirstResponder to NO to block the keyboard & menu. Also I have disabled scrolling by setScrollEnable:NO and setEditable:NO

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号