简体   繁体   中英

iOS: How do I create irregularly shaped / partially transparent & click-thru buttons

How would I create these buttons, so that clicking handles correctly?

替代文字

Each button is a .png , transparent outside of the coloured square. I need a transparent areas to be click-thru.

I have posted an article on how to do it here .

If you like it, please mark me up -- I currently don't have enough reputation points to do very much on this site.

On clicking the button, check the location where it is clicked. Detect the pixel alpha at that location. If alpha is 0 the disable the click else enable it. This would definitly help.

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