Jaz*_*jeb 7 xamarin xamarin.forms
我是 Xamarin-Forms 的新手,正在开发登录表单并使用 Material Design ( IVisual)。我创建了一个自定义 Entry 类并继承它来自MaterialEntryRenderer定义它。我想要实现的目标是删除下划线Entry。我看过很多例子,但它们都用了EntryRenderer。
public class CustomEntryRenderer : MaterialEntryRenderer
{
public CustomEntryRenderer(Context context) : base(context) { }
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.Background = null;
Control.SetBackgroundColor(Android.Graphics.Color.Transparent);
}
}
}
Run Code Online (Sandbox Code Playgroud)
它适用于EntryRenderer但不适用于MaterialEntryRenderer.
Ole*_*leg -2
尝试更改文本颜色属性。
根据消息来源,它将改变你想要的:
_textInputLayout.BoxBackgroundColor = MaterialColors.CreateEntryFilledInputBackgroundColor(Element.BackgroundColor, Element.TextColor);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15976 次 |
| 最近记录: |