Implementing round buttons
I am building a simple app that displays a grid, similar to a guitar neck, and I wanted to draw oval buttons at each intersection of the grid, an开发者_JAVA技巧d attach behaviors to it, like tapping once for sound. Pretty straight forward stuff...
My question is about the use of class for the buttons.
I am able to draw some good looking buttons with UIBezierPath/bezierPathWithOvalInRect:
and now I want interactivity. I read in this forum from one developer that he used a button underneath an image to capture user interaction. I have tried that but I cannot fade out the button all together, as interaction is removed altogether.
- Is it possible to draw rounded buttons with UIButton from interface builder?
- What is best practice for something simple like drawing rounded buttons and capturing user interaction?
you can try layer.cornerRadius using the QuartzCore framework.
Or, just use an image as a custom button.
精彩评论