Search code examples
objective-cios6uiimage

How to add image as button in objective c?


I want to add image as button, and when it is clicked it should open a new view controller... Does anyone know how to do?

I created a button and added image, but its not nice, because when I click on the image it animates a square arround the image, which I do not want. This what I did.

- (void)setTutorialButtonImage
{
    [self.tutorialButton setImage:[UIImage imageNamed:@"app_logo.png"] forState:UIControlStateNormal];
}

Does any one know how to do... just an image and when I click on it start a new controller


Solution

  • You can disable the highlighting effect by using

    self.tutorialButton.adjustsImageWhenHighlighted = NO;