UIImage *buttonImageNomal=[UIImage imageNamed:@"buttonNomal.png"];
UIImage *stretchableButtonImageNomal=[buttonImageNomal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[self.doSomething setBackgroundImage:stretchableButtonImageNomal forState:UIControlStateNormal];
UIImage *imageButtonPress=[UIImage imageNamed:@"buttonPress.png"];
UIImage *stretchableButtonImagePress=[imageButtonPress stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[self.doSomething setBackgroundImage:stretchableButtonImagePress forState:UIControlStateHighlighted];
如何设置按钮背景图片
最新推荐文章于 2022-07-12 23:53:05 发布