简体   繁体   中英

How to make a triangle on top of the UIView

How can a make a triangle on top of the UIView as a anchor to a UIButton , like in the picture below? I want the triangle to change the position when the other Button is selected. Please only answers written in swift. :)

在此处输入图片说明

Your screen shot displays a popover . Use a UIPopoverController and you'll get the triangle automatically.

Sometimes solutions are simpler then expected. Just draw all three triangles in storyboard. Then in your UIController you use the hidden flag to show or hide the triangle.

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