modify
This commit is contained in:
@@ -296,17 +296,25 @@ public class ApplicationChrome
|
||||
public const int ADJUST_PAN = 0x20;
|
||||
public const int ADJUST_NOTHING= 0x30;
|
||||
public const int ADJUST_UNSPECIFIED = 0x00;
|
||||
static int softInputMode = 0;
|
||||
public static void setSoftInputMode(int mode)
|
||||
{
|
||||
#if USE_ANDROID
|
||||
//Debug.Log("FLAGS: " + flagsValue);
|
||||
softInputMode = mode;
|
||||
runOnAndroidUiThread(_setSoftInputMode);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void _setSoftInputMode()
|
||||
{
|
||||
#if USE_ANDROID
|
||||
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
|
||||
{
|
||||
using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
|
||||
{
|
||||
using (var window = activity.Call<AndroidJavaObject>("getWindow"))
|
||||
{
|
||||
window.Call("setSoftInputMode", mode); // (int)0x7FFFFFFF
|
||||
window.Call("setSoftInputMode", softInputMode); // (int)0x7FFFFFFF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user