【发布时间】:2018-11-09 09:31:10
【问题描述】:
我正在尝试从汉堡菜单中隐藏该栏,并仅保留 Uber App 之类的图标按钮。
我有一个默认的母版页详细结构,我尝试了多种解决方案:
1 - 在 App.xaml 中
<ResourceDictionary>
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="Transparent"/>
<Setter Property="BarTextColor" Value="Red"/>
</Style>
</ResourceDictionary>
2 - MasterDetailPageRenderer
public class CustomMasterDetailRenderer : MasterDetailPageRenderer
{
public CustomMasterDetailRenderer(Android.Content.Context context):base(context)
{
}
protected override void OnLayout(bool changed, int left, int top, int right, int bottom)
{
base.OnLayout(changed, left, top, right, bottom);
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
if (toolbar != null)
{
toolbar.SetBackgroundColor(Android.Graphics.Color.Argb(0, 0, 0, 0));
}
}
}
不幸的是,得到了这个结果:
【问题讨论】:
-
你是如何隐藏你的工具栏而只显示菜单按钮的?
-
我问的问题...怎么做...阅读@HeikkiDev 答案
-
是的,我现在知道了。
标签: c# xamarin xamarin.forms