自定义编辑器不允许拼写检查

时间:2021-01-21 16:41:55

标签: c# xaml xamarin xamarin.forms

我有一个小的自定义编辑器(仅用于删除 android 中的子行):

    protected override void OnElementChanged(ElementChangedEventArgs<Editor> e)
    {
        base.OnElementChanged(e);

        if (Control != null)
        {
            GradientDrawable gd = new GradientDrawable();
            gd.SetColor(global::Android.Graphics.Color.Transparent);
            this.Control.SetBackgroundDrawable(gd);
            this.Control.SetRawInputType(InputTypes.TextFlagAutoComplete);
            this.Control.SetRawInputType(InputTypes.TextFlagAutoCorrect);
            //Control.SetHintTextColor(ColorStateList.ValueOf(global::Android.Graphics.Color.Black));
        }
    }

如您所见,为了允许自动更正或自动完成,我给了它我能找到的两个标志。

更重要的是,我也在 XAML 中这样做了:

 <icustomcomponents:IEditor 
                                    Keyboard="Default"
                                    x:Name="editor_desc"
                                    IsSpellCheckEnabled="True"
                                    MaxLength="1500"
                                    IsTextPredictionEnabled="True"
                                    TextColor="#424242"
                                    FontFamily="Font_11"
                                    Margin="5,0,0,5"
                                    BackgroundColor="#00000000"
                                    PlaceholderColor="#9b9b9b"
                                    Placeholder="Beschreibung" />

再次为它提供我能找到的关于拼写检查的所有属性。

但它毫无意义:拼写检查或自动完成或其他任何东西 - 没有启用任何东西,这真的很烦人。

我错过了什么?一面旗帜?

0 个答案:

没有答案