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
14
votes
9 answers

UINavigationBar TitleView with subtitle

I want a titleView inside my UINavigationBar which has two lines of text instead of only one My current implementiation works well when I have a "Back"-Button and an "Edit" Button because it looks nearly centered. The problem is when I only have one…
Stefan Edler
  • 141
  • 1
  • 1
  • 4
11
votes
2 answers

iOS 11 - UINavigationItem titleView when using Large Titles mode

I'm trying to understand either it's a bug or it's the expected behavior. On iOS 10 and earlier we could set up a custom title, using navigationItem.titleView. On iOS 11, when setting our navigationItem.largeTitleDisplayMode = .always and setting…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
10
votes
4 answers

Custom title view as large title in iOS 11 new navigation bar

I am using a button as a title view for my UITableViewController which opens a dropdown list of categories. Selecting a category filters content of the table view by the selected category. The button shows the name of the selected category plus a…
Denis Balko
  • 1,566
  • 2
  • 15
  • 30
10
votes
1 answer

Can you use UIAppearance to set the titleview of UINavigationItem?

I currently use this code to set the titleView of my navigation item: - (void)viewDidLoad { ... UIImage *navbarTitle = [UIImage imageNamed:@"navbartitleview1"]; UIImageView *imageView = [[UIImageView alloc]initWithImage:navbarTitle]; …
djblue2009
  • 1,342
  • 1
  • 17
  • 23
9
votes
2 answers

iOS 11 Navigation TitleView misplaced

I have an iOS app in which I am setting a custom navigation title view. It was working fine till iOS 10, but in iOS 11 the navigation title view is misplaced. Here is the screen shot for iOS 10 - Here is the screen shot for iOS 11 - As you can see…
Prateek Varshney
  • 1,114
  • 2
  • 12
  • 29
9
votes
3 answers

UIBarButtonItem height in landscape iPhone

I have a nav bar in an iPhone app with a custom UIBarButtonItems in it: UIBarButtonItem* homePersonButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"homePerson.png"] style:UIBarButtonItemStylePlain …
toofah
  • 4,455
  • 4
  • 31
  • 42
8
votes
3 answers

Custom titleView on UINavigationController is animating incorrectly

I'm probably doing something wrong here because this looks a bit stupid. I'm setting up a custom titleView (in the form of a UILabel) on my UINavigationController that is the same on every page. To facilitate this, I've created a function in my app…
death_au
  • 1,282
  • 2
  • 20
  • 41
6
votes
2 answers

UINavigationItem titleView animation

I am using a UIImageView-based animation to show a custom activity indicator. The following code is responsible for setting this : + (void)startLoadingActivity:(UIViewController *)vc { vc.parentViewController.navigationItem.titleView =…
thegameg
  • 281
  • 4
  • 14
5
votes
1 answer

Custom TitleView with Description and Preview Image Android TV (FireTV)

I am trying to build my first Amazon Fire TV app using Android Lean back library. I want to customise the BrowseFragment to look like the image shown below. I tried setting a custom layout as below. @Override public View…
Nabeel K
  • 5,938
  • 11
  • 38
  • 68
5
votes
1 answer

What is the default fontsize, fontname and shadow for titles in Navigation Bar?

I'm trying to have a button on the self.navigationItem.rightButton that toggles a segmented control that is placed in self.navgivationItem.titleView .. this will however remove the title that is first set by self.title when the navbar is created ..…
5
votes
2 answers

Autoresize titleView in a NavigationBar with autolayout

I want a custom UIView in my UINavigationBar between a left and a right BarButtonItem but as wide as possible. For this reason I added a UIView in IB to the NavigationBar. With autolayout disabled everything works as expected with the autoresizing…
4
votes
0 answers

Centering a dynamically-sized `titleView` in navigation bar without autolayout

I'm new to iOS layouts, and I'm trying to programmatically centre a custom view (actually a React Native RCTRootView which extends UIView, if that's relevant) which has intrinsically sized, dynamic content (defined over in javascript land). I've…
Rob Hogan
  • 2,442
  • 19
  • 23
4
votes
1 answer

Navigation custom titleView no longer visible only on iOS 11

I have a custom view as search bar and set it to Navigation titleView. CustomView is no longer visible on iOS 11 devices alone. I debugged with Hierarchy View and I found that custom view's frame size is (0,0). This issue happens only on iOS 11, it…
4
votes
3 answers

UINavigationItem TitleView disappears

I am trying to create a custom titleView for a navigation bar. I am able to set the titleView in the root view controller that is embedded in a navigation controller. When I push the second view controller onto the stack and try to set the titleView…
4
votes
3 answers

Get correct bounds for navigationItem.titleView layoutSubviews

I have a subclass of UIView that I've added to as the titleView of a navigationItem using the following line of code: self.navigationItem.titleView = tempview; Easy enough. That works fine. My problem is that this navigationItem sometimes has the…
mjdth
  • 6,536
  • 6
  • 37
  • 44
1
2 3 4 5 6 7