创建一个button设置背景图片,然后加一个label在button上,设置label的text的字体大小,不起作用,请问怎么修改?代码如下
returnButton = [UIButton buttonWithType:UIButtonTypeCustom];
returnButton.frame = CGRectMake(10, 9, 50, 28);
[returnButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
[returnButton setImage:[UIImage imageNamed:@"US MEAT_buttons.png"] forState:UIControlStateNormal];
[returnButton setImage:[UIImage imageNamed:@""] forState:UIControlStateHighlighted];
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(8, 2, 50, 20)];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.font = [UIFont fontWithName:@"STHeiti-Medium.ttc" size:10];
label.text = @"返回";
[returnButton addSubview:label];
[label release];