If you want to have UIBarButtonItem
everywhere in your application, what you can do is in your AppDelegate.m
and in your application:didFinishLaunchingWithOptions:
method, you can write
[[UIBarButtonItem appearance] setBackgroundImage:[[UIImage alloc] init] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
This will create an empty image, and it will set UIBarButtonItem
's background to that image. With writing it into AppDelegate
you will make sure everywhere you are using a UIBarButtonitem
it will have transparent background, even your back buttons.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…