@ Christopher Fairheim has the right to propose the use of UIButtonTypeCustom. Using UIButtonTypeRoundedRect will give you a white background in transparent areas.
However, connecting objects in Interface Builder has its limitations. If you want to dynamically generate UIViews, UIButtons and assets from a dataset or based on user input, doing this programmatically is the way to go.
: (: UIButtonTypes, UIButtonTypeCustom .)
UIButton *btnName = [UIButton buttonWithType:UIButtonTypeCustom];
:
btnName.backgroundColor = [UIColor clearColor];
btnName.frame = CGRectMake(100, 100, 72, 37); //(X coord, Y coord, width, height)
[btnName addTarget:myActionClassName action:@selector(myActionName) forControlEvents:UIControlEventTouchUpInside]
(, .png):
UIImage *btnNameImageNormal = [UIImage imageNamed:@"btnNameNormal.png"];
[btnName setBackgroundImage:btnMenuImageNormal forState:UIControlStateNormal];
UIImage *btnNameImagePressed = [UIImage imageNamed:@"btnNamePressed.png"];
[btnName setBackgroundImage:btnNameImagePressed forState:UIControlStateHighlighted];
( viewController):
[self addSubview:btnName]
( , .)