I figured out a way to do this ....... anyway I have to create all the buttons with the corresponding text using photoshop....these are the steps that i followed
1. Add the images to resource folder.
2. Open your view in IB and drag a button select Custon button.
3. Choose the required image from the image dropdown.
4. Create an IBOutlet in ur viewController.h
Code:
{
IBOutlet UIButton *myButton;
}
@property (nonatomic,retain) UIButton *mybutton;
-(IBAction)buttonPressed:(id)sender;
@end
5. In viewController.m
Code:
@synthesize mybutton;//under the implementation of interface
........
......
......
-(IBAction)buttonPressed:(id)sender{
[myButton setImage:[UIImage imageNamed:@"image.png"] forstate:UIControlStateHighlighted]; //(image.png)= the image which required to be shown when button needs to be pressed.
}
6. Go back to IB and connect the button to myButton and buttonPressed function( select touch down)
7. Build it and run you will be able to see your button changing to second image when u press it.
PS: I dont know whether this is the right way to do it, but it works. I am typing this in windows PC @ home..... no access to codes...so forgive me for typo errors