如何获得 Windows 平板电脑的数字键盘?
How to get numeric keyboard for Windows tablets?
我想要 Windows 平板电脑的数字键盘。我使用代码
Keyboard="Numeric"
但它获得 Android 设备、iOS 设备和 Windows phone 的数字键盘。它没有为 Windows 平板电脑带来数字键盘。我提到 它说在平板电脑中获取数字键盘是不可能的。我想知道有什么方法可以获得此功能。也许使用自定义渲染器或依赖注入。如果有怎么办?
这是已知问题,已在最新版本中修复,请将 Xamarin.Forms nuget 包版本更新为最新稳定版本(包含在 UWP 客户端项目中)
更新
[assembly: ExportRenderer(typeof(Entry), typeof(MyEntryRenderer))]
namespace App10.UWP
{
public class MyEntryRenderer : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.InputScope = Element.Keyboard.ToInputScope();
}
}
}
}
我想要 Windows 平板电脑的数字键盘。我使用代码
Keyboard="Numeric"
但它获得 Android 设备、iOS 设备和 Windows phone 的数字键盘。它没有为 Windows 平板电脑带来数字键盘。我提到
这是已知问题,已在最新版本中修复,请将 Xamarin.Forms nuget 包版本更新为最新稳定版本(包含在 UWP 客户端项目中)
更新
[assembly: ExportRenderer(typeof(Entry), typeof(MyEntryRenderer))]
namespace App10.UWP
{
public class MyEntryRenderer : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
Control.InputScope = Element.Keyboard.ToInputScope();
}
}
}
}