Hi,
I have a simple button and I want to put an image inside, so I have this code:
myButton = [[UIButton alloc] initWithFrame:CGRectMake(20, 13, 116, 138)];
UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[self.visuel lpath] ofType:@"jpg"]];
[myButton setImage:image forState:UIControlStateNormal];
in InterfaceBuilder Its easy to tell my image to take the size and width of my button but how to do that programmatically? do I have to use myButton.contentHorizontalAlignment =..... something like that?
Best Regards,