UIButtonbackgroundImageストレッチの問題を解決します

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