Magnify button on iphone
Is there a way to magnify a button when you touch it? similar to the keyboard when writing a text message, the key you press gets magnified so you can see which button you a开发者_如何学Gore actually pressing.
You can also do this by this method:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
and when the user touches your button then you can change the button's frame (buttton.frame
).
I would suggest you to have two different appearers of your button and it can be achieved through the your button states : Link to state:
UIControlStateNormal,
UIControlStateHighlighted,
Now you need to use the following set of function
- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state
- (void)setImage:(UIImage *)image forState:(UIControlState)state
- (void)setTitle:(NSString *)title forState:(UIControlState)state
- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state
- (void)setTitleShadowColor:(UIColor *)color forState:(UIControlState)state
Read Apple Documentation
Hope your could magnify your button to some extend.
精彩评论