I’m using TouchScreenKeyboard API and it activates keyboard and input field when I call TouchScreenKeyboard.Open()
I want to know the height of input field in android phone.
I found this code
using(AndroidJavaClass UnityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
AndroidJavaObject View = UnityClass.GetStatic<AndroidJavaObject>("currentActivity").Get<AndroidJavaObject>("mUnityPlayer").Call<AndroidJavaObject>("getView");
using(AndroidJavaObject Rct = new AndroidJavaObject("android.graphics.Rect"))
{
View.Call("getWindowVisibleDisplayFrame", Rct);
return Screen.height - Rct.Call<int>("height");
}
}
But, it seems to be getting the height of the keyboard.
How can I get the height of input field or the height of input field + keyboard?