Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My understanding is that Interface Builder is, more or less, mimicking what you would do if you did the same thing programmatically using the UIBarButtonItem class. The various items in a navigation bar are instances of the UIBarButtonItem class. This class has the following initializers:</p> <pre><code>– initWithBarButtonSystemItem:target:action: – initWithCustomView: – initWithImage:style:target:action: – initWithTitle:style:target:action: – initWithImage:landscapeImagePhone:style:target:action: </code></pre> <p>When you just have a title for the navigation controller, Interface Builder treats it similar to using the <code>initWithTitle:</code> initializer. Basically, this means that, under the hood, a UILabel class is created with the given title and that UILabel is used as the view for the UIBarButtonItem.</p> <p>When you are dragging the transparent view over the title, however, Interface Builder is instead doing the equivalent of calling <code>initWithCustomView:</code>. This means that the view you are providing is being used as the UIBarButtonItem's view. In other words, when you drag the custom view over the title, you are not placing it <em>on top of</em> the title. You are <em>replacing</em> the title with the transparent view.</p> <p>One option might be to create a view which has both a UILabel and the transparent view as subviews. Then place that view as the title for the navigation bar. If you give that UILabel the correct font size and shadow, it will look indistinguishable from the system's default title and you will also be able to have the transparent view on top of it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload