[assembly: ExportRenderer(typeof(AppShell), typeof(CustomShellRenderer))]
namespace App4.Droid
{
public class CustomShellRenderer : ShellRenderer
{
public CustomShellRenderer(Context context) : base(context)
{
}
protected override IShellBottomNavViewAppearanceTracker CreateBottomNavViewAppearanceTracker(ShellItem shellItem)
{
return new CustomShellBottomNavViewAppearanceTracker();
}
}
public class CustomShellBottomNavViewAppearanceTracker : IShellBottomNavViewAppearanceTracker
{
public void Dispose()
{
}
public void ResetAppearance(BottomNavigationView bottomView)
{
}
public void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
{
(bottomView.Parent as LinearLayout)?.SetBackgroundColor(Color.Transparent.ToAndroid());
bottomView.SetBackgroundColor(Color.Transparent.ToAndroid());
bottomView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityUnlabeled;
}
}
}
shell自定义渲染器在android中
我想将内容部分和底部导航部分重叠
我知道如何在没有shell和CustomRender的情况下实现纯XAML,但我不想这样做,因为我的项目高度依赖于Shell
例如)
https://github.com/naweed/MauiPlanets
上面的应用程序是重叠底部导航和内容页面在我的情况下删除标签栏背景和保留图标简单地说,我想降低与底部导航重叠的内容页面的高度。
1条答案
按热度按时间aoyhnmkz1#
如果我没理解错的话,全屏应该能满足你的需要。
将此添加到您的
MainActivity.cs
: