【发布时间】:2020-11-12 17:10:27
【问题描述】:
我目前正在使用 Xamarin Forms 中的 UWP 项目。
当我使用默认的条目和编辑器时,它带有我希望删除的边框以及添加圆形背景。
我已经设置了渲染器和一些代码,但边框仍然完好无损。
[assembly: ExportRenderer(typeof(Xamarin.Forms.Entry), typeof(MyRenderer))]
namespace App1.UWP
{
class MyRenderer : SearchBarRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if(Control != null)
{
Control.Background = null;
}
}
}
}
【问题讨论】:
-
您可以设置 BorderThickness = "0" 和 TextControlBorderBrush 为
Transparent。
标签: xamarin xamarin.forms