0

I should to reproduce this behavior

image

I've tried using NSGradient with a simple linear gradient in order to fill it but it's a poor result. What kind of gradient is it?

danielemm
  • 1,636
  • 1
  • 14
  • 24

1 Answers1

0

Are you putting the button in a UINavigationBar or a toolbar?

UIBarButtonItem will do that shading on its own, but it tends to live in a toolbar or navbar.

Ben Mosher
  • 13,251
  • 7
  • 69
  • 80
  • No no wait. I want to re-create the same gradient in my custom view (basically I'm porting the appearance of this iOS control under Mac OS X Cocoa) and I need to know how to reproduce the same gradient – danielemm Aug 03 '11 at 11:17
  • Ah. In that case, you may have some success with this: http://cocoawithlove.com/2008/09/drawing-gloss-gradients-in-coregraphics.html – Ben Mosher Aug 03 '11 at 11:32
  • It's not exactly what you're looking for, but it might help get you on your way. – Ben Mosher Aug 03 '11 at 11:33