سؤال

I have a tab controller with four items in it. Second item is a navigation controller with a table view. I want to place logo of my app instead of title. Finally I can show my logo, but I can't understand how to scale it down to the size of Navigation Bar. Size of my image is 59x68px.

I do the followings thing in MyTableViewController viewDidload

[super viewDidLoad];

self.navigationController.navigationBar.translucent= NO;

UIImage *image = [UIImage imageNamed:@"assorti_logo.png"];
UIImageView *myImageView = [[UIImageView alloc] initWithImage:image];

myImageView.contentMode = UIViewContentModeScaleAspectFill;

self.navigationItem.titleView = myImageView;

I tried a lot of solutions from here, and non works. Is there any way to scale this image to match navigation bar height. Or what size of image should I use to see correct image both on iPhone 4s and 5?

هل كانت مفيدة؟

المحلول

I've finally found out the problem. I needed only to rename my image file to "logo@2x.png" The key is "@2x" in the end.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top