IOS 8 TabBar pictures show True Colors

Source: Internet
Author: User

"Exhibition Letter Yan Open" How do I think of this word ... Because this is enough to express my current mood, has solved a problem, has a harvest.

My little friend in the morning asked me, "Do you want to use your own tab to change the color of the chart?" Change TabItem. "I remember being able to show it, but as he asked, it must have been an experiment, so I started my journey with relative idleness.

After running the previous project, I found that if the old code had no effect on iOS 8, first attach the previous code

[Tabbaritem setfinishedselectedimage:[uiimage imagenamed:@ "Selectimage.png"] withfinishedunselectedimage:[uiimage imagenamed:@ "Image.png"];

Now that there is no effect, it means that this method may not be used on the iOS8, click to view, if so

-(void) Setfinishedselectedimage: (UIImage *) selectedimage withfinishedunselectedimage: (UIImage *) Unselectedimage NS _deprecated_ios (5_0,7_0, "use initWithTitle:image:selectedImage:or the image and SelectedImage properties along with Uiimagerenderingmodealwaysoriginal ");

  

In this way, this method in the iOS7 above although has the effect, but should not use, but should use the new method provided later, because I understanding a little bit, tried several times to find the actual use of the method

UIImage * Normalimage = [[UIImage imagenamed:@ "Image.png"]  Imagewithrenderingmode: Uiimagerenderingmodealwaysoriginal]; UIImage * Selectimage = [[UIImage imagenamed:@ "Selectimage.png"]  Imagewithrenderingmode: Uiimagerenderingmodealwaysoriginal]; Uitabbaritem * Tabbaritem = [[Uitabbaritem alloc]initwithtitle:@] "Image:normalimage selectedimage:selectimage";

  

OK is a satisfactory solution good happy ah;

IOS 8 TabBar pictures show True Colors

Related Article

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.