方法一:
//背景图片
UIImageView *bgImageView = [MyUtil createImageViewFrame:CGRectMake(0, 0, 65, 23) imageName:@"StarsBackground"];
[self addSubview:bgImageView];
//前面的图片
UIImageView *fgImageView = [MyUtil createImageViewFrame:CGRectMake(0, 0, 56, 23) imageName:@"StarsForeground"];
//设置停靠模式
fgImageView.contentMode = UIViewContentModeLeft;
fgImageView.clipsToBounds = YES;
fgImageView.tag = 200;
[self addSubview:fgImageView];
方法二:直接剪裁图片