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

hotkarl

macrumors newbie
Original poster
Nov 19, 2010
29
1
Northern Utah
Can I change the alpha of just the button's background image? If I change the button's alpha [button setAlpha: 0.2] the text's alpha changes as well and I'd like the text to stay bright white. Any way?
 
Don't think so directly. You could create a new blank image and draw the existing image into with a given alpha value, then set that as the button's image.
 
Dig. Thank you for your reply.

Don't think so directly. You could create a new blank image and draw the existing image into with a given alpha value, then set that as the button's image.

But when I click a button it looks like the background alpha changes while the text changes color over top.

adjustsImageWhenHighlighted
A Boolean value that determines whether the image changes when the button is highlighted.

@property(nonatomic) BOOL adjustsImageWhenHighlighted
Discussion
If YES, the image is drawn lighter when the button is highlighted. The default value is YES.

Availability
Available in iOS 2.0 and later.


Isn't there a way to do that to the image?
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.