我正在 iPhone 中以编程方式使用按钮开发图像。现在我想为下一个和上一个按钮添加按钮背景图像。我想以编程方式为这些按钮添加图像。
如何在iphone中添加按钮图片。
最佳答案
//像这样添加按钮
UIImage *redButtonImage = [UIImage imageNamed:@"ExitButton.png"];
UIButton *redButton = [UIButton buttonWithType:UIButtonTypeCustom];
redButton.frame = CGRectMake(280.0, 10.0, 29.0, 29.0);
[redButton setBackgroundImage:redButtonImage forState:UIControlStateNormal];
[view addSubview:redButton];
关于iphone - 如何在 iphone 中以编程方式实现带有背景图像的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5012305/