Question

        - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
        {      
            [[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:230.0f/255.0f green:200.0f/255.0f blue:160.0f/255.0f alpha:1.0f]];
            >>EXC_BAD_ACCESS
            [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault];
            // Override point for customization after application launch.
            return YES;
        }

in didFinishLaunchingWithOptions I'm doing a simple code that works fine in the iOS 7.1 but does not work in 7.0

Error: CGImageProviderCreate: invalid image provider size: 128 x 0.

Error: CGImageCreate: invalid image size: 128 x 0. Unable to create image from csi bitmap data

navBarBackground located in Media.xcassets. Im using Xcode 5.1

Any idea how to fix it?

Was it helpful?

Solution

I solved the problem. In this image in Media.xcassets, you must set the slicing at least by 1px enter image description here

OTHER TIPS

If you want to tint the UINavigationBar, you have to use setBarTintColor:

[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:230.0f/255.0f green:200.0f/255.0f blue:160.0f/255.0f alpha:1.0f]];

Edit:

Your background image for the UINavigationBar has to have 320x64 pixels and need to be PNG.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top