首页 > 代码库 > 通过路径获取图片及改变图片颜色

通过路径获取图片及改变图片颜色

        NSString *starsPath = [[NSBundle mainBundle] pathForResource:@"star" ofType:@"png"];

        UIImage *theImage = [[UIImage alloc] initWithContentsOfFile:starsPath];



        theImage= [theImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

        stars.tintColor = [UIColor orangeColor];



        stars.image = theImage;



通过路径获取图片及改变图片颜色