In my Xamarin Forms iOS application the previous page name is also appearing with the back button in all pages. Is there any way to hide the title of the previous page?
-
1My application is Xamarin forms not xamarin native ios app. – Aneesh.A.M Sep 16 '15 at 07:02
4 Answers
If you use Navigation Page, you can use an empty string for the Back button title:
NavigationPage.SetBackButtonTitle(this, ""); //Empty string as title
As far as I remember, it will affect the next page on the navigation stack (the page after 'this' will have an empty Back button title). Don't quote me on this.
You can completely hide the Back button with:
NavigationPage.SetHasBackButton(this, false);
Another option is to use a Modal page by replacing Navigation.PushAsync(yourPage)
with Navigation.PushModalAsync(yourPage)
which will present the page modally.
FYI, the back button is automatically populated with the Title property of the previous page (or it will default to Back if the Title was not set).

- 1,073
- 1
- 11
- 22
-
-
1@RenzoCiot It's a static method, just in case you're trying to invoke it on an instance. – Aleksei Kosozhikhin Oct 04 '16 at 07:00
There is also one workaround to hide back button title globally in whole application. Add in your AppDelegate.cs in FinishedLaunching method:
UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment (new UIOffset (-100, -60), UIBarMetrics.Default);

- 121
- 2
- 2
Adding to Cuckooshka answer, back button title gets hidden in landscape mode as
UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment (new UIOffset (-100, -60), UIBarMetrics.LandscapePhone);

- 51
- 5
If you navigate from Page1 to Page2, then in Page1:
public Page1()
{
NavigationPage.SetBackButtonTitle(this, "");
InitializeComponent();
}
If everything is correct, in Page2 you will not see the title of navigation bar.

- 1,131
- 11
- 6