Below code is perfectly working fine iOS 5, but not on iOS 6 or above.
What I want that for Email composer sheet the navigationBar image will be different then other UINavigationBar classes. I can’t understand that debug pointer is responding the appearance method but on device it shows navigationBar image as “bgNavigationBar.png”; expected is “bgNavigationBar_2.png”.
Please guide me…….
if ([[UINavigationBar class]respondsToSelector:@selector(appearance)]) {
UIImage *logoImage44 = [[UIImage imageNamed:@"bgNavigationBar.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:logoImage44 forBarMetrics:UIBarMetricsDefault];
UIImage *ImagePlain = [[UIImage imageNamed:@"bgNavigationBar_2.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage:ImagePlain forBarMetrics:UIBarMetricsDefault];
}
This thing is not working in ios6.
Just you need to set this property in your Mail Handler Class.
and then reset another image for all other navigation controller’s background image.
Hope this will work for you.