Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UINavigationBar appearance crash in iOS 7.0

        - (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?

like image 426
R00We Avatar asked Dec 25 '22 09:12

R00We


1 Answers

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

like image 139
R00We Avatar answered Dec 28 '22 08:12

R00We