解决UIButton的backgroundImage拉伸的问题

UIImage *bgImage = [UIImage imageNamed:@"health_ranking"];
bgImage = [bgImage stretchableImageWithLeftCapWidth:bgImage.size.width/2 topCapHeight:bgImage.size.height/2];
[button setBackgroundImage:bgImage forState:UIControlStateNormal];

拉伸图片可以被拉伸的地方

猜你喜欢

转载自blog.csdn.net/qq_28285625/article/details/104775349
今日推荐