UIButton *button= [[UIButton alloc] initWithFrame:CGRectMake(0,0,70,70)];
button.buttonType = UIButtonTypeCustom;
UIImage *buttonImage = [UIImage imageNamed:@"image.png"];
UIImage *stretchableButtonImage = [buttonImage stretchableImageWithLeftCapWidth:12 topCapHeight:0];
[button setBackgroundImage:stretchableButtonImage forState:UIControlStateNormal];
如何让一个button 的 backgroundimage 等比例缩放 background imageview 并不完美
最新推荐文章于 2024-07-12 08:59:50 发布
本文详细介绍了如何创建并自定义一个按钮的外观和行为,包括设置按钮类型、加载图片资源、应用可拉伸图像以及调整按钮背景样式。
768

被折叠的 条评论
为什么被折叠?



