我遇到了关于 Xamarin Forms 的Entry Class的问题。问题是,当我在这个Entry
中输入文字时,文字是黑色的..
问题是,在点击之前,文字是White
,占位符是Gray
,但是,当我输入时,文字是黑色而不是{{1}我喜欢..
有条目:
White
然后, UWP 平台的渲染器:
public class CustomEntry : Entry
{
/// <summary>
/// The HasBorder property.
/// </summary>
public static readonly BindableProperty HasBorderProperty =
BindableProperty.Create(nameof(HasBorder), typeof(bool), typeof(CustomEntry), true);
/// <summary>
/// Assessor for the HasBorder property.
/// </summary>
public bool HasBorder
{
get { return (bool)GetValue(HasBorderProperty); }
set { SetValue(HasBorderProperty, value); }
}
/// <summary>
/// The XAlign property
/// </summary>
public static readonly BindableProperty XAlignProperty =
BindableProperty.Create("XAlign", typeof(TextAlignment), typeof(CustomEntry), TextAlignment.Start);
/// <summary>
/// Gets or sets the X alignment of the text
/// </summary>
public TextAlignment XAlign
{
get { return (TextAlignment)GetValue(XAlignProperty); }
set { SetValue(XAlignProperty, value); }
}
}
有人有任何想法吗?我没有尝试Android / iOS ..
提前感谢您的帮助!