iOS 7 - UITextView clipping text

冷暖自知 提交于 2019-12-23 03:51:48

问题


I'm trying to fit 3 lines of text in a textview of a certain size by using

[_messageField setContentInset:UIEdgeInsetsMake(-8, -6, 0,0)];

This works in iOS 6, but iOS 7 seems to be clipping content at the bottom of the textview. Both of the textviews shown below have the same font, text, and edge insets. Line 3 does not appear in iOS 7.


回答1:


I had success using

[_messageField setTextContainerInset:UIEdgeInsetsMake(0, 0, 0, 0)];

and adjusting as needed.




回答2:


This solved the issue I was having.

self.textView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f);
self.textView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);


来源:https://stackoverflow.com/questions/20961870/ios-7-uitextview-clipping-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!