如何使 UITextView 在特定行而不是最后一行向上滚动?
我想让 UITextView
看起来像 Notes 应用程序中的 UITextView
,但我不知道如何让它在特定行而不是默认的最后一行向上滚动当按下回车键时。如果没有,UITextView
底部的几行将被虚拟键盘重叠。
任何想法、解决方案将不胜感激。
提前致谢。
I'd like to make a UITextView
looks like UITextView
in Notes application but I don't know how to make it scroll up at specific row instead of the last row as default when press return. If not, a few rows at the bottom of UITextView
will be overlapped by the virtual keypad.
Any idea, solution would be appreciated.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用从 UIScrollView 继承的 contentOffset 属性,但您需要自己计算行位置。
You can use the contentOffset property inherited from the UIScrollView, although you will need to calculate the row position yourself.