Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iOS: How to make a UIButton get a blue shade when pressed?
- [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateNormal];
- [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateHighlited];
- state = NO
- if (state == NO) {
- [yourButton setBackgroundImage:@"blueimage.png" forState:UIControlStateNormal];
- [yourButton setBackgroundImage:@"blueimage.png" forState:UIControlStateHighlited];
- state = YES;
- }
- else {
- [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateNormal];
- [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateHighlited];
- state = NO;
- }
Add Comment
Please, Sign In to add comment