Note that there are some explanatory texts on larger screens.

plurals
  1. POMove a UIBarButton Item Down A Couple Pixels
    primarykey
    data
    text
    <p>I have a pop up window that slides on screen when a certain button is pressed.</p> <p>This view has a custom look apart from the rest of the app. It has an .xib file as well. I have managed to change the header background color by adding a customClass to the toolbar in IB. I have managed to change the text style of the title text... It took me some time to figure that out. What I had to do was make an IBOutlet from the title item in IB, then apply the changes in my m...like so</p> <pre><code> - (void)customizeAppearance { //Sets custom text attribures for this views headers text [_customNavText setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], UITextAttributeTextColor, //sets text color [UIColor blackColor], UITextAttributeTextShadowColor, //sets text shadow color [NSValue valueWithUIOffset:UIOffsetMake(0, 3)], UITextAttributeTextShadowOffset, //Moves drop shadow by its coordinates [UIFont fontWithName:@"Helvetica-Bold" size:27.0], UITextAttributeFont,nil] //sets text font and size forState:UIControlStateNormal]; } </code></pre> <p>and this function gets called once the view loads. So my text has its own style on this view only. Great.</p> <p>So, maybe I am getting to picky, but now I want to move the text down a couple pixels. </p> <p>This is what I did, I added the following code inside the customizeApperance function...</p> <pre><code>[[UIBarButtonItem appearance] setTitlePositionAdjustment:UIOffsetMake(25.0f, 25.0f) forBarMetrics:UIBarMetricsDefault]; </code></pre> <p>But this does something interesting, it does not move my text down for the UIBarButtonItem I have just applied those styles too, instead it moves the text of the buttons on the nav bar, such as the cancel button.</p> <p>So how do I move the UIBarButtonItem thats in the middle, containing text for the navigation header, rather than the text of the buttons on the side?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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