Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bytezone

macrumors member
Original poster
Apr 20, 2009
64
0
I am trying to put an image dynamicaly to a round rec button. But once I apply the image , the button does not appear as a round rect instead takes the look of square/rectangle.

1. How can I make the round rect btn look like round rect after adding iamge..??

2. Also I would like to display text after adding the image to button..how can I do this....??

3. How to make the button look gradient color....right now I am using a gradient image over btn to make it look like gradient. Any other options..??

Thanks in advance for help....
 
I am trying to put an image dynamicaly to a round rec button. But once I apply the image , the button does not appear as a round rect instead takes the look of square/rectangle.

1. How can I make the round rect btn look like round rect after adding iamge..??

2. Also I would like to display text after adding the image to button..how can I do this....??

3. How to make the button look gradient color....right now I am using a gradient image over btn to make it look like gradient. Any other options..??

Thanks in advance for help....
1. You can't.
2. The UICatalog sample app show you how to do this.
3. With a gradient image. See answer for #2.
 
For #1 you'd have to clip the image to the rounded rect, which is most likely just an image. You could do this by subclassing the button and setting the clip in the drawRect method, or clip the image before setting it as the image. This will be of help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.