我的目标是在 .Droid 项目的 xamarin 表单中的自定义控件上设置密码输入。
我的自定义渲染代码:
class MyEntryRendererPassword : EntryRenderer
{
//CUSTOM entry RENDER PER ANDROID
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.SetMaxHeight(150);
Control.SetTextColor(Android.Graphics.Color.Rgb(255,255,255));
Control.SetBackgroundColor(Android.Graphics.Color.Rgb(43, 50, 58));
//Control.SetRawInputType(InputTypes.TextFlagNoSuggestions | InputTypes.TextVariationVisiblePassword);
}
}
}
我已经测试了我在网上看到的许多代码,但没有成功。如何设置控制标签,如密码标签?用户写作时我会看到这些点。谢谢。