移动包含按钮的 UIView 会停止按钮响应

发布于 2024-09-16 12:31:55 字数 436 浏览 3 评论 0原文

我有一个 XIB 文件,其中包含一个包含两个按钮的子视图 (footerButtonsView)。我像这样更改子视图的位置:

if (footerView.frame.origin.y < 280.0) {    
    [footerButtonsView setFrame:CGRectMake(footerButtonsView.frame.origin.x, footerButtonsView.frame.origin.y+300.0-footerView.frame.origin.y, footerButtonsView.frame.size.width, footerButtonsView.frame.size.height)];
}

这将按预期移动包含按钮的视图,但按钮将不再对触摸做出反应。有人知道我在这里缺少什么吗? 谢谢!

I have an XIB file containing a subview (footerButtonsView) containing two buttons. I change the position of the subview like so:

if (footerView.frame.origin.y < 280.0) {    
    [footerButtonsView setFrame:CGRectMake(footerButtonsView.frame.origin.x, footerButtonsView.frame.origin.y+300.0-footerView.frame.origin.y, footerButtonsView.frame.size.width, footerButtonsView.frame.size.height)];
}

This moves the view containing the buttons as expected but the buttons would not react to touches anymore. Does anyone have an idea on what I'm missing here? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七堇年 2024-09-23 12:31:55

看起来您正在将视图移动到其父视图的边界之外?

Looks like you're moving the view outside the bounds of its parent view?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文