Questions tagged [titleview]

A custom view displayed in the center of the navigation bar when the receiver is the top item

Declaration

OBJECTIVE-C

    @property(nonatomic, strong) UIView *titleView

SWIFT

   var titleView: UIView?

If this property value is nil, the navigation item’s title is displayed in the center of the navigation bar when the receiver is the top item. If you set this property to a custom title, it is displayed instead of the title.

Custom views can contain buttons. Use the buttonWithType: method in UIButton class to add buttons to your custom view in the style of the navigation bar. Custom title views are centered on the navigation bar and may be resized to fit.

The default value is nil.

Availability

Available in iOS 2.0 and later.

Reference:

titleView Reference

98 questions
0
votes
2 answers

Unable to add UIScrollView to UINavigationBar

I want my scrollview to be added as UINavigationBar's titleview, but strangely I am unable to do so. In viewDidLoad: navController = [[UINavigationController alloc] init]; self.view.frame = CGRectMake(0, 0, [UIScreen…
NightFury
  • 13,436
  • 6
  • 71
  • 120
0
votes
1 answer

UINavigationController TitleView - Need clarification

Okay, there's one thing I really don't understand. I have a navigation controller (created in AppDelegate.m) as the first item in a tab bar controller (created in AppDelegate.h): self.tabBarController.viewControllers = @[tabOneNavigationController,…
Lord Zsolt
  • 6,492
  • 9
  • 46
  • 76
0
votes
1 answer

Strange Bug in iOS 6 UINavigationController

I have found a strange bug in ios. When I use UINavigationController and push other controllers, the titleView shifted to the right so much as how many controllers was pushed It's looks like this: My code is simple: self.navigationItem.title =…
0
votes
1 answer

Auto position subviews of UINavigationBar's titleView

I have a custom titleView for displaying Navigation title and sub-title. The title font is bigger than sub-title. Here's what I have now: CGRect headerTitleSubtitleFrame = CGRectMake(0, 0, 200, 44); UIView* _headerTitleSubtitleView = [[[UILabel…
AmitP
  • 5,353
  • 4
  • 35
  • 27
0
votes
1 answer

custom navigationitem titleview wrong frame

hi i just make a custom navigationitem title view, but it looks a bit wrong. here is the custom view ,it base on a uiview - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code …
Galen Zhao
  • 127
  • 1
  • 8
0
votes
1 answer

UINavigationBar titleView for different orientation

What is the best way to resize UINavigationBar titleview content image when orientation is changed. I have one image with 44px height and another for 32px and after view is rotated I change the titleview and set new imageview. but maybe there is…
taffarel
  • 4,015
  • 4
  • 33
  • 61
-1
votes
2 answers

Cant center UILabel in titleView of navigationItem iOS8

Im having trouble setting a programmatically allocated UILabel to be centered in my NavigationItem's titleView. Im even setting the NSAlignment to be NSAlignmentCenter. Here's an image of what it looks like: As you can see.. I have no right…
Chisx
  • 1,976
  • 4
  • 25
  • 53
-2
votes
1 answer

Can't update titleView image in App Delegate (Swift)

I want a logo to be present throughout my app. My entire app has an embedded Navigation Controller so I figured that I could set this image in the app delegate like so: let logo = UIImage(named: "logo") let imageView =…
user3612986
  • 315
  • 2
  • 7
  • 18
1 2 3 4 5 6
7