按钮里面没有ScrollView的可见部分

时间:2022-08-27 12:20:08

In the picture you can see the structure of my Storyboard: View -> ScrollView -> ContentView (view) -> Views . The button in blue image appears out of the screen in the phone, and when I move the scroll to it, the button doesn't detect the tap.

在图片中,您可以看到我的故事板的结构:视图 - > ScrollView - > ContentView(视图) - >视图。蓝色图像中的按钮出现在手机屏幕之外,当我将滚动条移动到该按钮时,按钮不会检测到水龙头。

I have read in many forums and I added this:

我在许多论坛上看过,我补充说:

    scrollView.userInteractionEnabled = Bool(true);
    scrollView.exclusiveTouch = Bool(true);

    scrollView.canCancelContentTouches = Bool(true);
    scrollView.delaysContentTouches = Bool(true);

In the StoryBoard I marked to de ScrollView "Delays Content Touches", and I marked to the button "User interaction enabled"

在StoryBoard中,我标记为de ScrollView“Delays Content Touches”,我标记为“启用了用户交互”按钮

I don't know what to do.

我不知道该怎么办。

按钮里面没有ScrollView的可见部分

1 个解决方案

#1


1  

Posting answer for others to see:

发布其他人的答案:

When adding a scroll view with a content view in Storyboard, please make sure that the content size of the Content View inside your Scroll View is equal to the content size of your scroll view.

在Storyboard中添加带有内容视图的滚动视图时,请确保滚动视图内的内容视图的内容大小等于滚动视图的内容大小。

Otherwise, your content view will not detect touches which is outside the bounds of your phone screen height.

否则,您的内容视图将不会检测超出手机屏幕高度范围的触摸。

Glad to be of help!

很高兴有帮助!

#1


1  

Posting answer for others to see:

发布其他人的答案:

When adding a scroll view with a content view in Storyboard, please make sure that the content size of the Content View inside your Scroll View is equal to the content size of your scroll view.

在Storyboard中添加带有内容视图的滚动视图时,请确保滚动视图内的内容视图的内容大小等于滚动视图的内容大小。

Otherwise, your content view will not detect touches which is outside the bounds of your phone screen height.

否则,您的内容视图将不会检测超出手机屏幕高度范围的触摸。

Glad to be of help!

很高兴有帮助!