문제

So I have created a UITabBarController as my root controller, then added UINavigationController as a tab bar item, and a UIViewController as a navigation item for it.

I want to set an image instead of the navigation item title, so I tried the following in viewDidLoad in the UIViewController, but it didn't work:

UIImage *image = [UIImage imageNamed:@"logo.png"];
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:image];

Any Suggestions?

Sorry for my poor English.

도움이 되었습니까?

해결책

Well guys, I have found out what went wrong!

I should have set the class property for the UIViewController to my custom class controller, that's why viewDidLoad was not being called.

Just follow this tutorial here, and everything should be fine.

http://www.youtube.com/watch?v=LBnPfAtswgw

Now, I want to push another view from the navigation controller?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top