Add image to a navigationItem's title
I’d like to add a logo to the left of my title on my navigation bar. The title property seems to only take an NSString. What’s the best way to add an image to the navigation bar?
- How to make an underlined text in UILabel?
- Send a tweet from iPhone app
- How to rotate an object around a arbitrary point?
- Is there any technical/conceptual reason why iOS does not support Cocoa Bindings?
- Which tasks are more suitable to NSOperation than GCD?
- How can I add CGPoint objects to an NSArray the easy way?
3 Solutions Collect From Internet About “Add image to a navigationItem's title”
You can replace the title view with an image like this:
navigationItem.titleView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"title_bar.png"]];
UINavigationItem.titleView to a custom view (or just a straight UIImageView).
You can customize
navigationItem.titleView, class of UIView
- How many urlRequests are handled by nsurlconnection
- How can I get indexPath.row in cell.swift
- What are the details of “Objective-C Literals” mentioned in the Xcode 4.4 release notes?
- Older SDK disappeared after installing new Xcode version
- How to check if a NSData is valid for usage in UIImage
- Changing VC issue in Swift. How to pass data between views in tab bar controller?
- difference between desiredAccuracy and distanceFilter
- How to check the LLVM compiler version Xcode is using?
- Draw SceneKit object between two points
- RegisterUserNotificationSettings is not working in ios 6.1
- Why must a protocol operator be implemented as a global function?
- matchesInString function returning an empty Array in Swift
- Overriding method with selector 'touchesBegan:withEvent:' has incompatible type '(NSSet, UIEvent) -> ()'
- __unused Flag Behavior/Usage (GCC with Objective C)
- Bypass code signing with Xcode 6