0

Problem :

I personalized my actionBar (SupportActionBar) with a renderer on my CustomNavigationPage beacause I use AppCompat theme. So, I added my CustomView (a SearchBar) in the actionbar from this class.

But ... when we change the orientation (Portrait->Landscape / Landscape->Portrait) my view disappear and I must recreate my CustomNavigationPage if I want to see again my CustomView.

I need your help, thank you in advance !

R.Extrant
  • 181
  • 3
  • 11

1 Answers1

0

Finally, I solved this problem by the id of the toolbar :

        int toolbarId = Resources.GetIdentifier("toolbar", "id", Android.App.Application.Context.PackageName);
        Android.Support.V7.Widget.Toolbar actionBar = (Android.Support.V7.Widget.Toolbar)FindViewById(toolbarId);

When we use AppCompat, it's the toolbar which is used. Then, I remove views and add again my CustomView.

R.Extrant
  • 181
  • 3
  • 11