2016-11-15 4 views

Antwort

0
You will need a custom render, here's how i have done it in IOS: (the thing is no way to you to get info from tamarin forms for the UIToolbarItem, so you can use the title to get the button u want or hardcode. 

(this code, shows moving the 1st button to the left, leaving the other 2 buttons on the right) attached a screenshot 

Create a custom PageRenderer to the page type where you want to access, 

[assembly: ExportRenderer(typeof(CategoriesPage), typeof(CategoriesPageRenderer))] 

and add 

    bool updatedButtons = false; 
     public override void ViewWillAppear(bool animated) 
     { 
      base.ViewWillAppear (animated); 

      if (!updatedButtons) 
       MoveButtonToLeft(); 
     } 


     protected void MoveButtonToLeft() 
     { 

      var infoButton = NavigationController.TopViewController.NavigationItem.RightBarButtonItems[0]; 
      NavigationController.TopViewController.NavigationItem.LeftBarButtonItem = infoButton; 

      var favButton = NavigationController.TopViewController.NavigationItem.RightBarButtonItems[1]; 
      var musicButton = NavigationController.TopViewController.NavigationItem.RightBarButtonItems[2]; 
      NavigationController.TopViewController.NavigationItem.RightBarButtonItems = new UIBarButtonItem[2] {favButton, musicButton }; 

      updatedButtons = true; 
     } 
Verwandte Themen