我的问题很简单,我认为这是可能的,但我找不到它。 我的设计是这样的
我为 textview
指定圆角半径,并设置 textContainerInset
左右两侧的填充
txtview_msg.textContainerInset = UIEdgeInsetsMake(5, 10, 10, 5)
现在我的问题就像前 2 行和最后 2 行一样,我的文本位于 textview 下方,所以我需要一些解决方案。
请帮我解决这个问题。谢谢
最佳答案
试试这个代码
UIView *paddingView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, txtview_msg.frame.size.height - 30)];
txtview_msg.leftView = paddingView1;
txtview_msg.leftViewMode = UITextFieldViewModeAlways;
UIView *paddingView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, txtview_msg.frame.size.height - 30)];
txtview_msg.leftView = paddingView2;
txtview_msg.rightViewMode = UITextFieldViewModeAlways;
关于ios - textview的文本在textview下重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41058535/