这是按钮对iPad Safari的影响:
现在我只有那样的图标文件:
如何以编程方式将带有图标图像的UIButton
作为背景显示为Safari
上的iPad
?
非常感谢!
答案 0 :(得分:0)
UIImage *buttonImage = [UIImage imageNamed:@"imageName.png"];
[btn setImage:buttonImage forState:UIControlStateNormal];
[self.view addSubview:btn];
尝试这个..
答案 1 :(得分:-1)
UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setFrame:CGRectMake(0, 0, 150, 30)];
[button setBackgroundImage:[UIImage imageNamed:@"bg.png"] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:@"ar.png"] forState:UIControlStateNormal];
bg.png
ar.png