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
- Remove the top line of 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 ();
- [TBCTabBar setbackgroundimage:img];
- [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