I have an image that I already use im my app like this via code:
UIImage *image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"building" ofType:@"png"]];
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
and I wanted to reuse that image in the UITabBar. There is an image field on the Attributes inspector of the UITabBar image, and when I add the image name there (either building or building.png) the image does not render, but an image outline renders.
Would anyone know why that happens and how I can get the actual image to render?
Thanks!
Here you are using an, I guess, a rather small image as a pattern to form a color. For the UITabBar you need to have images of appropriate size. UITabBar knows, as many others does, appearance methods to modify UI elements. Look for UIAppearance in the docs for more infos. As far as your question is concerned have a look for setFinishedSelectedImage:withFinishedUnselectedImage under UITabBarItem.