I need to draw a custom button with parallelogram's shape. What is the best way to do this? The image-way (i.e. to set background image for the control) is not suitable.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
The solution offered by Brain89 is good if you don't need to set any image for the button. I have background and content image and I need to make a parallelogram button without changing images. I use the next code:
Hopefully, it was very easy. After some googling I came up with the solution
UIParallelogramButton.h
UIParallelogramButton.m