IOS navigation bar black line, UIImage enumeration processing mode

Source: Internet
Author: User

iOS Find the black line below the navigation bar (can hide, change style, etc.)HTTP://WWW.JIANSHU.COM/P/EFFA4A48F1E3 setting the rendering mode for UIImage: uiimage.renderingmodehttp://blog.csdn.net/djxiaoyu_haha/ article/details/40949083 Coloring (Tint Color) is one of the iOS7 interfaces. Set the rendering mode of the UIImage: Uiimage.renderingmode A significant change, you can set a UIImage whether to use the tint Color of the current view when rendering. UIImage added a read-only property: Renderingmode, corresponding to a new method: Imagewithrenderingmode:, It uses the Uiimagerenderingmode enumeration value to set the Renderingmode property of the picture. The enumeration contains the following values:
    1. 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.
    2. Uiimagerenderingmodealwaysoriginal//Always draws the original state of the picture without using tint Color.
    3. Uiimagerenderingmodealwaystemplate//Always draws a picture based on tint color, ignoring the color information of the picture.

The default value of the Renderingmode property is Uiimagerenderingmodeautomatic, which is whether uiimage uses tint color depending on where it is displayed. Other conditions can be seen in the following illustration

The following code shows how simple it is to create a picture using an established rendering pattern:

    1. UIImage *img = [UIImage imagenamed:@ "MyImage"];
    2. IMG = [img imagewithrenderingmode:uiimagerenderingmodealwaystemplate];

IOS navigation bar black line, UIImage enumeration processing mode

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.