Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用C在xamarin.forms中启用所有键盘#_C#_Xamarin.forms_Keyboard - Fatal编程技术网

C# 如何使用C在xamarin.forms中启用所有键盘#

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 phone->virtual keyboard中,系统列出此页面中所有已启用的键盘,如何在我的Xamarin.forms应用程序中使用C#键入所有已启用的键盘

谢谢!
在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;
}
致以最良好的问候和感谢