I creat a button set the background image.then add a label to the button,I try to modify the size of font in label but failed.I don't know how to solve this ,anyone help me please.
this is my code:
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 = @"返回";//返回means "return"
[returnButton addSubview:label];
[label release];