在UIScrollView中可单击

在UIScrollView中可单击

本文介绍了UIButton不起作用/在UIScrollView中可单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UIScrollView的自动布局.

I am using auto layout with UIScrollView.

主要UIView高度= 1300

Main UIView Height = 1300

ContentView(在UIScrollBar之内)UIView = 1100

ContentView (within UIScrollBar) UIView = 1100

ConetntView在底部包含一个按钮.它是完全可见的,但是当我单击它时,它不起作用.

The ConetntView contains a button at the bottom. It is completely visible but when I click it, it does not work.

约束为:

1)ScrollView前导,尾随,顶部&底部为主要UIView

1) ScrollView leading, trailing, top & bottom with main UIView

2)ContantView前导,尾随,顶部& UIScrollView

2) ContantView leading, trailing, top & bottom with UIScrollView

3)ContentView&主要UIView

3) Equal height constraint between ContentView & main UIView

请帮助.

推荐答案

我必须从超级视图中为ContentView的底部空间提供(-)ve值.它完成了工作.最初将其设置为零,因此底部下方有很大的额外空间,这使滚动更大,这是不希望的.

I had to provide (-)ve value for bottom space of the ContentView from the superview. It did the job. Initially it was set to zero and because of this there was a large extra space below the bottom and it made the scrolling larger that was not desired.

我已经在所有模拟器中测试了它-4s到6+,并且工作正常.

I have tested it in all the simulators - 4s to 6+ and it is working fine.

感谢Nikolay的不断帮助.

Thanks to Nikolay for his continuous help.

由于我是iPhone开发的新手,所以我不知道我的解决方法是否正确.因此,如果还有其他解决方法,请告诉我.

Also as I am completely new to iPhone development so I do not know whether my workaround is correct or not. So if there is another solution to the problem then please let me know.

这篇关于UIButton不起作用/在UIScrollView中可单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 08:45