【发布时间】:2017-07-07 12:58:58
【问题描述】:
如何在 Xamarin.forms 中删除导航栏阴影和内容页面行。 是否可以在不渲染的情况下做到这一点。
【问题讨论】:
标签: xamarin.forms
如何在 Xamarin.forms 中删除导航栏阴影和内容页面行。 是否可以在不渲染的情况下做到这一点。
【问题讨论】:
标签: xamarin.forms
仅适用于 Xamarin Forms、iOS。将此添加到您的 AppDelegate
UINavigationBar.Appearance.ShadowImage = new UIImage(); //No line under the navigation
【讨论】:
在你的 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();
}
}
}
【讨论】: