UI 按钮点击问题 - Swift
UIbutton click issue - Swift
我正在尝试在子视图上添加登录按钮重叠,uibutton 的触摸事件在下半部分不起作用。
任何人都可以提供一个想法来实现这样的设计,所有角落都有触摸事件吗?
您的视图设置应该类似于:
正如 Inderjeet 在他的评论中提到的那样,"You have to keep button outside the UIView
otherwise it is not tap-able. Maintain the position of button according to UIView
by using constraints."
现在回答原因,将 view
的 clip to bounds 属性 设置为 true。您会看到,在 运行 时间,不可点击的部分也不可见。
我正在尝试在子视图上添加登录按钮重叠,uibutton 的触摸事件在下半部分不起作用。
任何人都可以提供一个想法来实现这样的设计,所有角落都有触摸事件吗?
您的视图设置应该类似于:
正如 Inderjeet 在他的评论中提到的那样,"You have to keep button outside the UIView
otherwise it is not tap-able. Maintain the position of button according to UIView
by using constraints."
现在回答原因,将 view
的 clip to bounds 属性 设置为 true。您会看到,在 运行 时间,不可点击的部分也不可见。