How to make transparent UIButton in UITableView Cell
When My .Xib File Is Loaded That Time UITableViewCell
is Fill Up With Black Background Color,For That, I am using
cell.contentView.backGroundColor = [UIColor开发者_JS百科 blackColor]
But In UITableViewCell
One UIButton
With "Custom" Button Type Is Generated Programatically
so the area Cover By UIButton
is a Not transparent
(Or Cell background - black Color is Not Display), it is a white color,,,
I Want To Make UIButton
With Transparent Background
SO How I Can ?
UIButton *button;
button.backgroundColor = [UIColor clearColor];
try this one it work for me
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(0.0, 5.0, 160.0, 40.0);
[button setBackgroundColor:[UIColor clearColor]];
[cell.contentView addSubview:button];
Why don't you make an image of button along with text you want to show and add this as button background with button type custom.
精彩评论