rjgonzo
rjgonzo

Reputation: 1761

What is better for custom iphone buttons, drawing them or regular UIButton?

I know I could simply use a regular UIButton and change the background image, but is that a good practice for custom buttons? Or is it better to draw the whole button with all the gradients/shadows/images?

Does either approach offer the same quality and performance?

Upvotes: 2

Views: 389

Answers (1)

Hermann Klecker
Hermann Klecker

Reputation: 14068

I'd say that a single image is more performant and cannot cost to much memory.

If the button is supposed to look like a real button, which I assume because your are talking about gradients, shadows and all the works, then it may be advisable to set button images for normal and highlighted states.

In that case UIButton does all the work for you.

(If you feel that I missed the point of that question, then please re-phrase your question.)

Upvotes: 2

Related Questions