IOS development tutorial-how to remove the top line of the tabbar and set the background image,
This problem has been quite distressing. Many Methods on the Internet have not been tested very well. Today we have finally solved it.
Directly run the Code:
CGRect rect = CGRectMake (0, 0, self. view. frame. size. width, self. view. frame. size. height );
UIGraphicsBeginImageContext (rect. size );
CGContextRef context = UIGraphicsGetCurrentContext ();
CGContextSetFillColorWithColor (context, [[UIColorclearColor] CGColor]);
CGContextFillRect (context, rect );
UIImage * img = UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();
[Self. tabBarsetBackgroundImage: img];
[Self. tabBarsetShadowImage: img];
[Self. tabBarsetBackgroundImage: [UIImageimageNamed: @ "tabbarbg3.jpg"];
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.