iOS development-No need to customize, modify Tabbar background color

Source: Internet
Author: User

Recently modified projects are based on iOS 5.0 or later, in version iOS 61, the system default Tabbar is black, but this project needs to be compatible with iOS 7 and iOS 8, we all know iOS 7 started, iOS UI entered a flat era, the change is quite large , tabbar default to the white translucent effect, the need to change the Tabbar to black effect, but do not want to change the source code too large, today is not laborious, found a solution.

The first thing to do is to create a Tabbarcontroller object, which is not much to say here.

Here's the main code:

UIView *backview = [[UIView alloc] Initwithframe:cgrectmake (0, 0, +)];backview.backgroundcolor = [Uicolor Blackcolo R]; [Self.tabBarController.tabBar Insertsubview:backview atindex:0];self.tabbarcontroller.tabbar.opaque = YES; [Backview release];


iOS development-No need to customize, modify Tabbar background color

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.