C# 如何使用C在xamarin.forms中启用所有键盘#
你好 在android phone->virtual keyboard中,系统列出此页面中所有已启用的键盘,如何在我的Xamarin.forms应用程序中使用C#键入所有已启用的键盘 谢谢!C# 如何使用C在xamarin.forms中启用所有键盘#,c#,xamarin.forms,keyboard,C#,Xamarin.forms,Keyboard,你好 在android phone->virtual keyboard中,系统列出此页面中所有已启用的键盘,如何在我的Xamarin.forms应用程序中使用C#键入所有已启用的键盘 谢谢! 在Android中滚动可以使用InputDevice 输入设备: 您可以尝试以下代码: int[] devicesIds = InputDevice.GetDeviceIds(); foreach (var item in devicesIds) {
在Android中滚动可以使用
InputDevice
输入设备
:
您可以尝试以下代码:
int[] devicesIds = InputDevice.GetDeviceIds();
foreach (var item in devicesIds)
{
//Check the device you want
InputDevice device = InputDevice.GetDevice(item);
//device.getName must to have virtual
var s = device.Name;
var b = device.KeyboardType;
}
您可以使用DependencyService
在Xamarin.Forms中调用它
DependencyService
:在Android中,您可以使用InputDevice
输入设备
:
您可以尝试以下代码:
int[] devicesIds = InputDevice.GetDeviceIds();
foreach (var item in devicesIds)
{
//Check the device you want
InputDevice device = InputDevice.GetDevice(item);
//device.getName must to have virtual
var s = device.Name;
var b = device.KeyboardType;
}
您可以使用DependencyService
在Xamarin.Forms中调用它
DependencyService
:谢谢您的回复,我尝试了您建议的方式,但返回的值不是我想要的
我找到了另一个帖子,用这种方式最终得到了我想要的东西
以下是我要共享的代码:
InputMethodManager manager = (InputMethodManager)context.GetSystemService(Context.InputMethodService);
IList<InputMethodInfo> mInputMethodProperties = manager.EnabledInputMethodList;
IEnumerator<InputMethodInfo> imi = mInputMethodProperties.GetEnumerator();
while (imi.MoveNext())
{
InputMethodInfo inputInfo = imi.Current;
var iN = inputInfo.ServiceName;
}
InputMethodManager=(InputMethodManager)context.GetSystemService(context.InputMethodService);
IList mInputMethodProperties=manager.EnabledInputMethodList;
IEnumerator imi=mInputMethodProperties.GetEnumerator();
while(imi.MoveNext())
{
InputMethodInfo inputInfo=imi.Current;
var iN=inputInfo.ServiceName;
}
致以最良好的问候和感谢
滚动谢谢您的回复,我尝试了您建议的方式,但返回的值不是我想要的 我找到了另一个帖子,用这种方式最终得到了我想要的东西 以下是我要分享的代码:
InputMethodManager manager = (InputMethodManager)context.GetSystemService(Context.InputMethodService);
IList<InputMethodInfo> mInputMethodProperties = manager.EnabledInputMethodList;
IEnumerator<InputMethodInfo> imi = mInputMethodProperties.GetEnumerator();
while (imi.MoveNext())
{
InputMethodInfo inputInfo = imi.Current;
var iN = inputInfo.ServiceName;
}
InputMethodManager=(InputMethodManager)context.GetSystemService(context.InputMethodService);
IList mInputMethodProperties=manager.EnabledInputMethodList;
IEnumerator imi=mInputMethodProperties.GetEnumerator();
while(imi.MoveNext())
{
InputMethodInfo inputInfo=imi.Current;
var iN=inputInfo.ServiceName;
}
致以最良好的问候和感谢
滚