我想创建一个UIButton
使用它的setBackgroundImage
,setImage
和setTitle
属性的,但是当我添加时setTitle
,setImage
标题setBackgroundImage
不会出现。
我试过以下。
[button setBackgroundImage:[UIImage imageNamed:@"image3.jpg"] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"month_pct_general.png"] forState:UIControlStateNormal];
[button setTitle:[NSString stringWithFormat:@"%d",[button tag]] forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button.titleLabel setFont:[UIFont boldSystemFontOfSize:20.0f]];
[button setTitleEdgeInsets:UIEdgeInsetsMake(45, 0, 0, 25)];