当我输入<截屏>时,三行的UITextView会自动向上滚动。 [英] UITextView with 3 lines automatically scrolls up when I enter <screen capture>
问题描述
我有一个UITextView,用于输入一些文本
(我已将其添加到界面生成器中)
我的字体高度为3高(因此,在我的情况下,框架高度为47),因此我可以输入3行文字
我要执行的操作是键入第3行,如果我转到第4行
,但是它的作用是每当我键入Enter时它就会自动上升,因此我不断在uitextview的顶部键入内容。
ive put在线捕获,显示它更清晰..即使当我单击一行时,它也会到达顶部!
就像把戏一样,是使字体变大
txtView.font = [UIFont systemFontOfSize:14];
当我使我的字体大小大2点时,只需键入正常字体即可,而不是每行向上。 / p>
I have a UITextView that i use for typing some text (i have added it with Interface builder)
i have made the height 3 font lines high (so in my case the frame height is 47) so i can have 3 lines of text
what i want it to do is type until line3 and the go up if i goto line 4 but what it does is whenever i type enter it automatically goes up so i'm constantly typing at the top of my uitextview
ive put a capture online that show it more cleary .. even when i click a line it goes to the top!
Click here for the screen capture
It looks like the trick is to make the font size bigger
txtView.font = [UIFont systemFontOfSize:14];
when i make my font size 2 points bigger it just types normal instead of going up every line.
这篇关于当我输入<截屏>时,三行的UITextView会自动向上滚动。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!