I'm developing images in view with button programmatically in iphone. now I want to add button backgroundimage for next and previous buttons. I want to add a images for these buttons programmatically.
how to add button image in iphone.
// Add the button like this
UIImage *redButtonImage = [UIImage imageNamed:@"ExitButton.png"]; UIButton *redButton = [UIButton buttonWithType:UIButtonTypeCustom]; redButton.frame = CGRectMake(280.0, 10.0, 29.0, 29.0); [redButton setBackgroundImage:redButtonImage forState:UIControlStateNormal]; [view addSubview:redButton];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With