iOS development-get rid of Tabbar top line

Source: Internet
Author: User

With the system Tabbar, if the whole tabbar is a regular rectangle, it is not easy to see the upper is a line, but irregular words, there will be a black line across there, very affect the interface beautiful, like this:

Located in Tabbar, and the button is tied, is a imageview:

To change it, you have to know what the specific name is, jump to the library's Tabbar file to look at, as follows:

There are three built-in image: Background picture, selected picture, Shadow picture,
And then modify these three image

Remove the top line of the Tabbar
CGRect rect = CGRectMake (0, 0, screenwidth, screenheight);
Uigraphicsbeginimagecontext (rect.size);
Cgcontextref context = Uigraphicsgetcurrentcontext ();
Cgcontextsetfillcolorwithcolor (context, [[Uicolor Clearcolor] cgcolor]);
Cgcontextfillrect (context, rect);
UIImage *img = Uigraphicsgetimagefromcurrentimagecontext ();
Uigraphicsendimagecontext ();
[Tbc.tabbar setbackgroundimage:img];
[Tbc.tabbar setshadowimage:img];

Success. The results are as follows:

Principle: Actually did not delete the horizontal line (remove off), just turn it into transparent does not affect the operation and the interface is beautiful just (visual error).

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.