A read-only property of UIImage: Renderingmode, which corresponds to a method: Imagewithrenderingmode, which uses the Uiimagerenderingmode enumeration value to set the Renderingmode property of the picture. The enumeration contains the following values:
- Uiimagerenderingmodeautomatic//Adjusts the rendering mode automatically based on the environment in which the picture is used and the drawing context in which it is located.
Uiimagerenderingmodealwaysoriginal//Always draws the original state of the picture without using tint Color. (This enumeration value declares that the image is to be displayed as it was originally, and does not need to be rendered as a different color) because the Apple system itself has a default rendering color
- Uiimagerenderingmodealwaystemplate//Always draws a picture based on tint color, ignoring the color information of the picture.
UIButton *loginbtn ==*loginimg = [UIImage imagenamed:@ "login" == loginBtn.currentImage.size; // The size of the image taken to the button Loginbtn.frame =cgrectmake (size.width, size.height); Self.view ADDSUBVIEW:LOGINBTN];
Imagewithrender (rendering mode for pictures)