0
votes

I'd like to have a NavigationPage using xamarin forms (iOS and Android), with a footer (footer would be static when the pages move inside the NavigationPage), this footer is NOT a toolbar, I'd like it to be fuly customisable (StackPanel).

On a higher stand point, it means having a Page inside an other page.

I see several approachs, that all needs custom renderer :

  • Create a custom "ContentPage", with stacked in it a NavigationPage and a StackLayout for the footer...

  • Customize the NavigationPage itself to display the footer...

  • Something else ?

Is it even possible ? What would be the best approach ? Did someone succeded to do that ?

PS : I came acrosse this thread that almost achieve this : http://forums.xamarin.com/discussion/36897/put-a-page-inside-another-page#latest

Thx

1
If you want to add footer on multiple Navigation Pages and Content Pages then use Content View inside your page.Asfend Yar

1 Answers

1
votes

This can definitely be done, but not by putting a ContentPage in a ContentPage. You never really want to have a ContentPage inside a ContentPage unless it's a Navigation/MasterDetail/Tabbed page, eg A ContentPage can go in TabbedPage. It might be possible but it's not standard probably come back to bite you in the future.

There's a few options:

  1. Have the footer on every content page, you could do this via inheritance which you could do with a Grid or other various layouts. The good part about this is that you don't need a custom renderer but it might not look the best when moving between pages.
  2. Rethink you UI so you don't need to do it exactly this way, is there an easier way to get the same affect but staying within the Xamarin.Forms controls? - 'Dont fight the framework'.
  3. Build a custom Navigation Renderer which has the view at the bottom with this you could have the footer be static between page transitions. But it wouldn't be as easy to implement as you would need a Custom Renderer, you would also need to know Xamarin.Forms, Xamarin.iOS and Xamarin.Android fairly well. *note you might also be able to do this with MessageCentre.

All those are possible, it's up to you in which to implement, depending on your personal time/knowledge/budget etc.

Thanks