我正在尝试在按钮上显示文本,但没有任何显示。
LocationButton = [[UIButton alloc] init];
UIImage * Location_buttonImages = [UIImage imageNamed:@"button~iphone.png"];
[LocationButton setTitle:@"Loca" forState:UIControlStateNormal];
[LocationButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[LocationButton setImage:Location_buttonImages forState:UIControlStateNormal];
[LocationButton setImage:[UIImage imageNamed:
@"button_select~iphone.png"]
forState:UIControlStateSelected];
LocationButton.frame = CGRectMake(20,212,90,40);
[LocationButton addTarget:self action:
@selector(action:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:LocationButton];
我可以看到图像,但看不到文字。请帮忙!