Is posible add effect to a ToolbarItem

nnovalbosnnovalbos ✭✭Member ✭✭

Hello,

I need to apply an effect that simulates movement in a toolbar item. I tried to add an effect but the effect never runs

Thanks

Best Answer

  • nnovalbosnnovalbos ✭✭ ✭✭
    Accepted Answer

    Hello @LandLu

    Finally I used PageRenderer for add effect to page toolbar item. With NavigationRenderer I set style to navigation's bar but was more difficult add effect to a determinate toolbar item.

    Thanks for answering.

Answers

  • LandLuLandLu Xamurai Member, Xamarin Team Xamurai

    We can't use effect on ToolbarItems the OnAttached event will not be called: https://github.com/xamarin/Xamarin.Forms/issues/5337
    If you want to change the navigation bar's style on each platform you can consume custom renderer.
    For iOS:

    [assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]
    namespace App.iOS
    {
        public class CustomNavigationRenderer : NavigationRenderer
        {
            public override void ViewDidLoad()
            {
                base.ViewDidLoad();
                this.NavigationBar.TintColor = UIColor.Red;
                // ...
            }
        }
    }
    
  • nnovalbosnnovalbos ✭✭ Member ✭✭
    Accepted Answer

    Hello @LandLu

    Finally I used PageRenderer for add effect to page toolbar item. With NavigationRenderer I set style to navigation's bar but was more difficult add effect to a determinate toolbar item.

    Thanks for answering.

Sign In or Register to comment.