简体   繁体   中英

Swift: UIButton un-clickable overlapping views

when I'm unwinding a segue by clicking on a button with a cross image which is 1/4th inside a UIView and 3/4th outside the UIView now when I press on button the part which is inside the UIView then unwind segue works but if I click outside of UIView then it does not works.

点击这里查看图片

As you can see from above image if I click inside the blue line then other view controller opens and If I click outside blue line of cross button the unwinding of segue does't work, why?

You can View the Video

 <a href="https://imgflip.com/gif/24bh0k"><img src="https://i.imgflip.com/24bh0k.gif" title="made at imgflip.com"/></a> 

The cross button seems to be inside the card view rather than superview. Put the button inside superview, over the card view but outside the card view.

Do something like this 在此处输入图片说明

在此处输入图片说明

take the button up on the view and set its constraints properly . May be your problem will resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM