滚动后未启用UIScrollView中的UITextFied [英] UITextFied in UIScrollView not enabled after scrolling

查看:101
本文介绍了滚动后未启用UIScrollView中的UITextFied的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ViewController中添加了UIScrollView,并在UIScrollView

I Added a UIScrollView in a ViewController, And Added UIView under that UIScrollView

我在该UIView中添加了总数10 UITextFields, 滚动工作正常

I added total number 10 UITextFields in that UIView, Scrolling is Working fine

在Simulator/iPhone中运行App时,屏幕上显示的前6个UITextFields工作正常[响应触摸]而不滚动,而其余4个UITextFields不工作[不响应触摸],这将滚动后显示

While running App in Simulator/ iPhone, the First 6 UITextFields Working [Responding to touches] which are shown on the screen without scrolling, Remaining 4 UITextFields are not working [Not responding to the touches], which will shown after scrolling

请问有人可以指导我解决此问题吗?

Please can any one guide me to resolve this issue?

谢谢

更新: 我在ViewController中使用了它

UPDATE: I Used it in ViewController

override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 1070);
    }

ViewControllerStructure如下

ViewControllerStructure is as below

推荐答案

您的文本字段位于Superview范围之外.您应该调整视图的大小,以使所有文本字段都在范围之内.

Your text fields lies outside the superview bounds. You should resize the view so all the text fields will be within bounds.

这篇关于滚动后未启用UIScrollView中的UITextFied的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆