Xamarin表示UWP - 键入时的文本颜色

时间:2016-08-30 10:24:10

标签: textcolor

我遇到了关于 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 ..

提前感谢您的帮助!

0 个答案:

没有答案