I have a view hwre there are 4 buttons, when i click a particular button, the focus on that button changes to blue color, and the next view is displayed accordingly.. but i want a view , like when i just keep the mouse on the par开发者_Go百科ticular button, or when i just touch the particular button, it should get highlighted... similar to the one in web pages... is it possible in iphone
There is no way to detect your finger hovering over the button until you actually touch..
But you can use the following methods to change button appearances when its pressed but not yet released or whatever state you like to handle..
- (void)setTitle:(NSString *)title forState:(UIControlState)state;
- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;
- (void)setTitleShadowColor:(UIColor *)color forState:(UIControlState)state;
- (void)setImage:(UIImage *)image forState:(UIControlState)state;
- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;
精彩评论