移动包含按钮的 UIView 会停止按钮响应
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在将视图移动到其父视图的边界之外?
Looks like you're moving the view outside the bounds of its parent view?