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
1
vote
1 answer

Swift3 iOS -Rounded ImageView in Navigation TitleView Keeps Showing Square?

I have a rounded imageView that I use for the profile pic in my app. I use the code several times throughout the app in tableView cells and on different views in view controllers. The profile pic always displays as round. When I use the below code…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
1
vote
2 answers

adding icon between back button & title of navigation bar

I want to put an icon by side of the title of my navigation bar. I'd prefer not to implement it as a custom titleView, because then i'll need to create a custom titleView for each controller i put on the stack (and I have pretty deep nesting). I'm…
Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
1
vote
1 answer

iOS Setting navigation item title view frame glitches on iPhone 6 and up

I am using a UIButton for navigation item title view, and the width of the button is subject to change, so I'm setting the frame like below: CGFloat titleButtonTextWidth = [title…
funct7
  • 3,407
  • 2
  • 27
  • 33
1
vote
3 answers

Logo in Nav Bar Obj-C

I am trying to display my logo in my Navigation Bar but I can't get it to fit all the different sizes of phones. I can get it to fit one and it looks terrible on another. This is the closest Ive gotten to it looking good at all. Does anyone see how…
1
vote
0 answers

UISearchBar not fitting in UINavigationBar on iPad - iOS 8

I am trying to place a UISearchBar in a UINavigationBar's titleView. I have two solutions, both are inconvenient. First is : [self setSearchController:[[UISearchController alloc]…
1
vote
0 answers

label in navigationitem titleview positioning issue

I am trying to place a label in navigation item title view. In case of long titles,on pushing/popping to other screen, the label moves from its original position and a transition takes place. The code to set the label: -…
1
vote
1 answer

Custom Navbar titleView size issue when pushing next ViewController

I'm trying to have a custom titleView for Iphone app iOS 5.0+ . So I placed a graphic like this : UIView *customTitleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 104, 72)]; UIImageView *customTitleGraphics = [[UIImageView alloc]…
luca
  • 36,606
  • 27
  • 86
  • 125
1
vote
2 answers

How to get the height of navigationBar's titleView?

I use a button as the titleView. But when I want to get the height of the button, whennever I use the self.button.frame.size.height or self.navigationItem.titleView.frame.size.height, it always return 0; Other value (like x, y and width) may seems…
1
vote
3 answers

Why my iPhone app cannot call the delegate method

I'm developing the iPhone app. I custom defined the titleview for navigation bar. The title view contains a button, I also defined the delegate method to support the button click event. But when the button clicked, the delegate cannot be executed. I…
user429079
  • 213
  • 3
  • 8
0
votes
1 answer

How to change titleview of a navigation item inside Tab Bar controller?

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…
Mohamed Salem
  • 161
  • 3
  • 9
0
votes
1 answer

UINavigationBar title disappears

I have a tab bar controller with five view controllers which is modally presented from the main tab bar controller. Each view controller has a navigation controller with a visible navigation bar. On initial presentation of the tab bar controller,…
0
votes
1 answer

UINavigationController and titleView

My application fit inside a UINavigationController. Simply I setted up a MyUIViewController as rootViewController of navigationController and than I set up a customTitleView for the navigationItem of myViewController inside viewDidLoad. Now when I…
Gabriele
  • 1,163
  • 1
  • 11
  • 24
0
votes
1 answer

Centering NavigationPage.TitleView in WinUI

Running my ContentPage in WinUI, which is wrapped with a NavigationPage at runtime, needs a custom TitleView I've put the same content in both TitleView and Content sections:
John Mc
  • 212
  • 2
  • 16
0
votes
1 answer

Xamarin Android TitleView losing custom font

Something strange is happening, in my xamarin form application, my xaml pages have this custom titleview:
0
votes
1 answer

Xamarine Shell TitleView Button disappears in iOS

I'm struggling with this problem. In my content page i have a titleview containing a label and a button. If i execute in android everything works fine but in ios the button disappear out of the right of the screen. The code: