【发布时间】:2021-05-08 09:27:01
【问题描述】:
我在 UITextView 中显示条款和条件。当用户到达 UITextView 中文本的最后一行,然后只启用屏幕底部可用的按钮(导航到下一个屏幕)。
我已经使用文本视图委托实现了所需的逻辑。
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
float scrollViewHeight = scrollView.frame.size.height;
float scrollContentSizeHeight = scrollView.contentSize.height;
float scrollOffset = scrollView.contentOffset.y;
if (scrollOffset + scrollViewHeight == scrollContentSizeHeight)
{ // login to enable the button
}
}
此逻辑运行良好,但在 ipad Pro 设备中这会造成问题。 ipad pro 屏幕很大,无需滚动即可看到所有文字。
如何在不滚动的情况下在 UITextView 中查看文本。以及如何处理 ipad Pro 中的问题。
【问题讨论】:
-
你搞定了吗?
标签: ios objective-c uiscrollview uitextview uitextviewdelegate