【问题标题】:Remove Navigation Bar Shadow/Line in Xamarin.forms删除 Xamarin.forms 中的导航栏阴影/线条
【发布时间】:2017-07-07 12:58:58
【问题描述】:

如何在 Xamarin.forms 中删除导航栏阴影和内容页面行。 是否可以在不渲染的情况下做到这一点。

【问题讨论】:

    标签: xamarin.forms


    【解决方案1】:

    仅适用于 Xamarin Forms、iOS。将此添加到您的 AppDelegate

     UINavigationBar.Appearance.ShadowImage = new UIImage(); //No line under the navigation
    

    【讨论】:

      【解决方案2】:

      在你的 xamarin ios 项目中添加这个渲染类

      [assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]
      namespace YOUR_IOS_NAMESPACE
      {
          public class CustomNavigationRenderer : NavigationRenderer
          {
              public override void ViewDidLoad()
              {
                  base.ViewDidLoad();
                  NavigationBar.ShadowImage = new UIImage(); 
              }
          }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-10-28
        • 1970-01-01
        • 1970-01-01
        • 2019-10-15
        • 2016-07-02
        • 1970-01-01
        • 2014-11-23
        相关资源
        最近更新 更多