windows - 如何获得适用于 Windows 平板电脑的数字键盘?
问题描述
我想要 Windows 平板电脑的数字键盘。我用了代码
Keyboard="Numeric"
但它有适用于 Android 设备、iOS 设备和 Windows 手机的数字键盘。它没有为 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();
}
}
}
}
推荐阅读
- typescript - 由于较旧的 Typescript SDK,Visual Studio 2017 任务在 Azure 管道中失败
- r - 删除时间序列中的步骤
- javascript - 如何解决 Gulp 错误:imagemin.jpegtran 不是函数
- html - 如何使 2 个图标左对齐,右对齐?
- javascript - ng 组件没用
- bash - 仅在条件已满时执行脚本执行
- angular - 防止用户在没有 VIewChild 的情况下使用 mat-tab-group 导航到其他选项卡
- oauth-2.0 - microsoft oidc id token 的 oid 声明与 microsoft graph api 的 id get from me 相同吗?
- python - 使用 Tensorflow 模型正确构建文本数据以生成文本
- oracle - 通过 utl_file 用管道分隔而不是逗号