UIScrollView底部的UIButtons无法正常工作 [英] UIButtons at the bottom of UIScrollView not working
问题描述
我在我的故事板中创建了一个UIScrollView,并在容器View中添加了12个UIButtons,它位于UIScrollView内。
I created a UIScrollView in my storyboards and have added 12 UIButtons in a container View which is inside the UIScrollView.
在iPhone 5s模拟器上运行时,9个按钮可以在屏幕上看到,其他按钮只能在向下滚动时看到。
when running on the iPhone 5s simulator, 9 of the buttons can be seen on the screen, the rest of the buttons only can be seen when you scroll down.
最初可以在屏幕上看到的9个按钮可以与...互动。但是滚动视图底部的3个按钮(必须滚动才能看到)无法与之交互。
the 9 buttons that can be initially seen on the screen can be interacted with. However the 3 buttons at the bottom of the scroll view (which have to be scrolled to in order to be seen) cannot be interacted with.
我在应用程序上运行了iPhone 6模拟器显示屏幕上的所有12个按钮,无需滚动,底部3个按钮可用。
I ran the app on an iPhone 6 simulator which displays all 12 of the buttons on the screen without having to scroll and the bottom 3 buttons work.
我正在使用自动布局。
我试过摆弄UIScrollView的contentSize并没有帮助。
I have tried fiddling with the contentSize of the UIScrollView and it does not help.
推荐答案
看来你需要增加容器视图的框架高度。 scrollView的 contentSize
仅影响它的滚动方式,这与此无关。
It seems you need to increase the frame height of container view. The contentSize
of scrollView only affects how it will scroll, which is irrelevant here.
如果按钮位于容器视图,它仍然会出现。但是,它无法响应任何触摸事件。
If the button is outside the container view, it will still show up. However, it can't respond to any touch event.
这篇关于UIScrollView底部的UIButtons无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!