創(chuàng)建圖片
UIImage *image = [UIImage imageNamed:@"XXX"];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
添加圖片
imageView.image = image;//此時(shí)顯示原色圖片
改變圖片顏色
imageView.tintColor = color;//此時(shí)顯示改變顏色后的圖片
旋轉(zhuǎn)
[imageView setTransform:CGAffineTransformMakeRotation(M_PI)];
//CGAffineTransformMakeRotation 旋轉(zhuǎn)函數(shù)
//M_PI旋轉(zhuǎn)角度 我這里是旋轉(zhuǎn)180°
//旋轉(zhuǎn)的好處是 只給你一個(gè)右箭頭 你可以得到一個(gè)左箭頭 這類情況
旋轉(zhuǎn)和改變圖片顏色 都可以在圖片樣式一樣 只是顏色和角度有差異的情況使用 好處是不用丟很多差不多的圖片進(jìn)項(xiàng)目 可以節(jié)省一定容量