Questions tagged [backbarbuttonitem]
80 questions
1
vote
1 answer
Changing only the position of the default backBarButtonItem
So I have a custom nav bar in my iPad app which is a bit larger than the default 44 pixel bar (52 pixels tall). I want all the items in the nav bar to be center aligned which I have been able to do just fine with the exception of one item, the back…

shokaveli
- 478
- 7
- 14
1
vote
1 answer
UINavigationCotroller backBarButtonItem with other target than self
I am trying to change the action executed by pressing the backBarButtonItem of a Navigation Controller.
I know that i have to edit the backBarButtonItem before the next view (on which the button with custom behavior should appear) is pushed. So in…

FimS
- 13
- 3
1
vote
2 answers
Move UIBarButtonItem few pixels down?
I have created a custom UINavigationBar which is a tiny bit taller than Apples default navigation bar.
I can’t seem to find a way to move the UIBarButtonItem down to be directly centered between the two dashed lines.
Is there an easy way to do…

Adam H
- 1,521
- 2
- 16
- 19
1
vote
1 answer
How to resize navigation back button according to text (not using custom image)
I have View Controller inside of Navigation Controller. It has default back button with title of previous controller in navigation controller's stack. But button dont resize to text width.
So it looks like this:…

KaterinaPetrova
- 462
- 4
- 12
1
vote
1 answer
How do I edit the background color of backBarButtonItem (UINavigationItem) ? iOS 4.3 issue
I am trying to edit the background behind the backBarButtonItem as it insists on remaining white. I have edited the background color of the entire navigation bar but to no avail.
It only seems to affect iOS4 however, seeing as…

Andy Shephard
- 1,726
- 17
- 26
0
votes
2 answers
UINavigationBar troubles
In my app, i'm using a custom UINavigationBar and custom UIBarButtonItems in a NavigationController. My (custom) NavigationBar looks fine, but when I want to place my own backBarButtonItem and RightBarButtonItem, it goes wrong.
Installing my own…

Jelle
- 284
- 3
- 13
0
votes
2 answers
How to handle backBarButtonItem pressed?
I have almost done this in all the application but I have 3 views stacked in navigationController and I need to jump from the third view to the first view.
As I understand I can do this via viewWillDisappear only. But if I try this "jump" I will get…

Gargo
- 1,135
- 1
- 10
- 21
0
votes
0 answers
How to set the margin of backBarButtonItem?
How to set the margin of backBarButtonItem ?
Using these methods has no effect:
backItem.imageInsets = UIEdgeInsets(top: 0, left: 100, bottom: 0, right: 0)
backItem.width = 100
self.viewControllers.last?.navigationItem.backBarButtonItem = backItem

MarkMiao
- 213
- 1
- 2
- 7
0
votes
1 answer
How to customize the action of backBarButtonItem in Swift (iOS 14.4)
My application has one UINavigationController as the initial view controller, and RootViewControler as the root view controller for UINavigationController.
Then I created FirstViewController and SecondViewController, so we can navigate from…

xpingc
- 23
- 3
0
votes
1 answer
Back bar button showing a white box
I have a SwiftUI project but it shows a big white box with the back bar button.
Does anyone know how to fix it (Xcode version 12.5)?
Image:
My code:
import SwiftUI
import Firebase
struct ContentView: View {
var body: some View {
…

Ar10ar10
- 13
- 3
0
votes
2 answers
Change colour of back bar button item only in swift
I am trying to change the colour of the back bar button item in swift navigation bar.
Ultimately I aim to make something line this for the navbar:
This is my current code which gives me three back arrows as the back button item but how do I change…

Hasnaine Shafiq
- 73
- 9
0
votes
1 answer
Handle Back button NavigationController to push to another ViewController
im currently working on a flow like this: First after i pressed the Login Button on LoginVC -> Push to WebViewVC -> Press Back Button on NavigationBar -> Push to a TabbarVC with also contain the webViewVC, i mean webViewVC is a tab of TabbarVC. So I…

Duy Khanh Nguyen
- 45
- 2
- 12
0
votes
4 answers
BackBarButton won't display correct title
I am trying to set my backButton to a simple "<" like this:
self.navigationItem.backBarButtonItem = UIBarButtonItem(title:"", style:.Plain, target:nil, action:nil)
print(self.navigationItem.backBarButtonItem?.title)
The printing will display "",…

JVS
- 2,592
- 3
- 19
- 31
0
votes
2 answers
Change BackBarButtonItem for All UIViewControllers?
I would like to change the BackBarButtonItem on all the views in my iOS app so that they show just the back arrow with no text.
Is the only way to accomplish this is to go through every UIViewController and set the…

Chris
- 5,485
- 15
- 68
- 130
0
votes
0 answers
Why is there functional difference between Swipe to pop view controller and poping view controller Programmatically?
When we Swipe right to Pop view controller/Click Back Button on navigation bar only ViewWillAppear code is called ,but , when we programmatically call [self.navigationcontroller popViewControllerAnimated:YES]; , It behaves differently , first…

user1147651
- 1
- 1