IOS off Image rendering

Source: Internet
Author: User

When you set a background picture for a button, you will find that the displayed effect is not the same as the picture given by the UI, and tends to show the picture as blue, because the image is automatically rendered in the new version of iOS.

All we have to do is turn the picture off.

-(UIImage *) Imagewithrenderingmode: (Uiimagerenderingmode) Renderingmode

This method is used to set the rendering mode of the image.

Uiimagerenderingmodealwaysoriginal This enumeration value is to declare that the picture is to be displayed as it was originally, and that it does not need to be rendered into another color

UIImage *playimage = [UIImage imagenamed:@ "Luzhi"];
Playimage = [Playimage imagewithrenderingmode:uiimagerenderingmodealwaysoriginal];
[_playbtn setimage:playimage Forstate:uicontrolstatenormal];

IOS off Image rendering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.