Forum Xamarin.Forms

How to access “tabBarController: shouldSelectViewController:” on Xamarin.Forms?

LuizNegriniLuizNegrini USMember ✭✭
edited October 2019 in Xamarin.Forms

I need to have control of this method so that I can make a change in my app. But I couldn't make this implementation work, can anyone help?

Here is the Custom Renderer of my TabbedPage:

public class MainTabbedPageRenderer : TabbedRenderer, IUITabBarControllerDelegate
     public bool ShouldSelectViewController(UITabBarController tabBarController, UIViewController viewController)
          return false;

The breakpoint does not stop there at all.

I have the impression that it does not stop at breakpoint because TabBarController is always null, but the screen loads and performs navigations normally, I also could not make this TabBarController be filled.

You can click on tabbar items using this method:

public void ItemSelected(UITabBar tabbar, UITabBarItem item)

Best Answer


  • LuizNegriniLuizNegrini USMember ✭✭

    Thanks @LandLu !!!!!

Sign In or Register to comment.