0

这是 iPad Safari 上按钮的效果:
iPad Safari

现在我只有这样的图标文件:
动作图标

如何UIButton以编程方式使图标图像作为背景看起来像Safarion iPad

非常感谢!

4

2 回答 2

0
UIImage *buttonImage = [UIImage imageNamed:@"imageName.png"];
[btn setImage:buttonImage forState:UIControlStateNormal];
[self.view addSubview:btn];

试试这个。。

于 2013-05-29T08:43:51.803 回答
-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.pngbg.png

ar.pngar.png

于 2013-05-29T08:56:15.767 回答