gpt4 book ai didi

objective-c - UITextView 从 iOS10 底部开始

转载 作者:搜寻专家 更新时间:2023-10-30 20:24:17 27 4
gpt4 key购买 nike

之前有一个已知问题,UITextViews 从 View 底部开始,然后必须向上滚动。

我之前使用以下方法解决了这个问题

-(void)viewDidLayoutSubviews {
[self.desc setContentOffset:CGPointZero animated:NO];
}

但是自从更新到 iOS 10 之后,这并没有解决问题。有人有任何更新的修复程序吗?

最佳答案

试试这个,这是我以前用来解决这类问题的方法,我希望它能起作用。

- (void)viewDidLayoutSubviews {
// To make the textView scroll to begining of the text view
[self.myTextView scrollRectToVisible:[self.myTextView caretRectForPosition:self.myTextView.beginningOfDocument] animated:NO];
}

关于objective-c - UITextView 从 iOS10 底部开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40060615/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com