我想要通过编程在我的按钮(红色按钮)上添加一个带有图像和文本“查看详情”的功能...
图像位于按钮的左侧,文本位于右侧。
UIImage *img = [UIImage imageNamed:@"image.png"];
[aButton setImage:img forState:UIControlStateNormal];
aButton.backgroundColor=[UIColor redColor];
//[img release]; i am not sure i release it or not
//[testBtn setTitleEdgeInsets:UIEdgeInsetsMake(70.0, -150.0, 5.0, 5.0)];
// what the above lines line work?
[aButton setTitle:@"View Details" forState:UIControlStateNormal];
我看到了按钮,但不是红色的按钮...只有红色的角落...