Hello,

Here is how to code a UIButton with an image inside it.

1) Open your Viewcontroller.h file and the following:

Code:
@interface ButtonsViewController : UIViewController
{
	UIButton *imageButton;
}

@property (nonatomic, retain) UIButton *imageButton;

@end
In your ViewController.m file add the following:


Code:
- (void)viewDidLoad {
    
	
	
	imageButton = [UIButton buttonWithType:UIButtonTypeCustom]; //sets the type of UIButton

	imageButton.frame = CGRectMake(150, 119, 71, 31); //sets the coordinates and dimensions of UIButton
	imageButton.backgroundColor = [UIColor clearColor]; //sets the background color

	[imageButton setBackgroundImage:[UIImage imageNamed:@"chrome.png"] forState:UIControlStateNormal]; //sets the Background image 

	[imageButton setImage:[UIImage imageNamed:@"UIButton_custom.png"] forState:UIControlStateNormal]; //sets the image

	[super viewDidLoad];
	
	[self.view addSubview:imageButton];

}
IF YOU NEED ANY HELP PLEASE DON'T HESITATE TO ASK BY LEAVING A REPLAY BELOW

here is a screenshot of the result: