0

I am trying to extend my pages from my Shell under the bottom tabbar in iOS

MyShellRenderer:ShellRenderer class

[assembly: ExportRenderer(typeof(AppShell), typeof(MyShellRenderer))]
 namespace your namepace
 {
   class MyShellRenderer:ShellRenderer
   {
      protected override IShellTabBarAppearanceTracker CreateTabBarAppearanceTracker()
      {
          return new MyShellTabBarAppearanceTrancker();
      }
   }
 }

MyShellTabBarAppearanceTrancker class:

class MyShellTabBarAppearanceTrancker : IShellTabBarAppearanceTracker
{
    public void Dispose()
    {

    }

    public void ResetAppearance(UITabBarController controller)
    {
      
    }

    public void SetAppearance(UITabBarController controller, ShellAppearance appearance)
    {
       controller.TabBar.IsTranslucent = true;        
    }

    public void UpdateLayout(UITabBarController controller)
    {
        
    }
}

But it does not work, the Shell keep all pages above the bottom tabbar (like in a stacklayout).

ArthurCPPCLI
  • 1,072
  • 7
  • 18

1 Answers1

0

Use Alpha instead of IsTranslucent .

The value of this property is a floating-point number in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque.

Try to set it as controller.TabBar.Alpha = 0.5f; .

Test code in xaml

   <Grid>
        <Label Text="111" VerticalOptions="Start"/>
        <Label Text="222" Margin="30,0,0,-50" VerticalOptions="End"/>
    </Grid>

enter image description here

ColeX
  • 14,062
  • 5
  • 43
  • 240
  • idk how but it does not works for me :/ Is it possible to accomplish this in a renderer without having to put transparency ? – ArthurCPPCLI Aug 10 '21 at 08:51
  • without having to put transparency ? What does that mean ? – ColeX Aug 10 '21 at 09:09
  • opaque bar (with solid color), i explain why i want to achieve this : because i added rounded corner (top left and top right) to the tabbar but the view is above the tabbar, so the rendering is bad and the solution is the view should pass under the tabbar – ArthurCPPCLI Aug 10 '21 at 09:11