如何删除Xamarin表单中的主详细信息页面和内容页面之间的分隔线

时间:2016-06-18 00:47:21

标签: c# xamarin xamarin.forms

如何从“内容”页面中删除状态栏u之间的灰色分隔线 这是一个主要详细信息页面,其中包含内容页面作为详细信息。

查看截图 enter image description here

1 个答案:

答案 0 :(得分:1)

根据this SO问题,您可以创建类似于此的自定义渲染器:

[assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationPage))]
namespace CustomNavigationPage.iOS
{
    public class CustomNavigationPage : NavigationRenderer
    {
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            NavigationBar.SetBackgroundImage(new UIKit.UIImage(), UIKit.UIBarMetrics.Default);
            NavigationBar.ShadowImage = new UIKit.UIImage();
        }
    }
}