Guest User

Untitled

a guest
Aug 25th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. iOS: How to make a UIButton get a blue shade when pressed?
  2. [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateNormal];
  3. [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateHighlited];
  4. state = NO
  5.  
  6. if (state == NO) {
  7. [yourButton setBackgroundImage:@"blueimage.png" forState:UIControlStateNormal];
  8. [yourButton setBackgroundImage:@"blueimage.png" forState:UIControlStateHighlited];
  9. state = YES;
  10. }
  11. else {
  12. [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateNormal];
  13. [yourButton setBackgroundImage:@"normalimage.png" forState:UIControlStateHighlited];
  14. state = NO;
  15. }
Add Comment
Please, Sign In to add comment