"IOS" Remove the top line of Tabbar

Source: Internet
Author: User

When using 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 influential interface beautiful, like this:

Open to the project look, it is this line:

Located in Tabbar, and the button side by side, is a imageview:

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

There are three built-in images: A background image, a picture when selected, a shadow picture,

Then modify these three image

[OBJC]View PlainCopy
  1. Remove the top line of Tabbar
  2. CGRect rect = CGRectMake (0, 0, ScreenWidth, screenheight);
  3. Uigraphicsbeginimagecontext (rect. Size);
  4. Cgcontextref context = Uigraphicsgetcurrentcontext ();
  5. Cgcontextsetfillcolorwithcolor (context, [[Uicolor Clearcolor] Cgcolor]);
  6. Cgcontextfillrect (context, rect);
  7. UIImage *img = Uigraphicsgetimagefromcurrentimagecontext ();
  8. Uigraphicsendimagecontext ();
  9. [TBCTabBar setbackgroundimage:img];
  10. [TBCTabBar setshadowimage:img];


Success! The results are as follows:

Principle: Actually did not remove the horizontal line (remove), just to turn it transparent does not affect the operation and the interface Beautiful (visual error).

"IOS" Remove the top line of Tabbar

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.