UIBarButtonItem setBackButtonTitlePositionAdjustment
Sets the back button title offset for given bar metrics
- (void)setBackButtonTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics
Parameters
adjustment
The back button title offset for barMetrics.
barMetrics
Bar metrics.
Discussion of [UIBarButtonItem setBackButtonTitlePositionAdjustment]
This modifier applies only to navigation bar back buttons and is ignored by other buttons.
UIBarButtonItem setBackButtonTitlePositionAdjustment example.
UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle: @"NewTitle" style: UIBarButtonItemStyleBordered target: nil action: nil];
[[self navigationItem] setBackBarButtonItem: newBackButton];
[newBackButton setBackButtonTitlePositionAdjustment:UIOffsetMake(0, 1.5) forBarMetrics:UIBarMetricsDefault];
[newBackButton release];
[[self navigationItem] setBackBarButtonItem: newBackButton];
[newBackButton setBackButtonTitlePositionAdjustment:UIOffsetMake(0, 1.5) forBarMetrics:UIBarMetricsDefault];
[newBackButton release];
Example of [UIBarButtonItem setBackButtonTitlePositionAdjustment].
UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init];
temporaryBarButtonItem.title = @"Back"; [temporaryBarButtonItem setBackButtonTitlePositionAdjustment:UIOffsetMake(0, 1.5) forBarMetrics:UIBarMetricsDefault];
self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
[temporaryBarButtonItem release];
temporaryBarButtonItem.title = @"Back"; [temporaryBarButtonItem setBackButtonTitlePositionAdjustment:UIOffsetMake(0, 1.5) forBarMetrics:UIBarMetricsDefault];
self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
[temporaryBarButtonItem release];
UIBarButtonItem setBackButtonTitlePositionAdjustment example.
UIImage *backButtonImage = [[UIImage imageNamed:@"Graphics/Shared/navigation_back_button.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, backButtonImage.size.height*2) forBarMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, backButtonImage.size.height*2) forBarMetrics:UIBarMetricsDefault];