2017-08-17 5 views
0

ソフトキーボードを表示しているときにツールバーを上に表示したい。私はwindowSoftInputModeですべてのオプションを試しましたが、それらのどれもうまくいきませんでした。これは、xamarinフォームを2.3.4.247にアップグレードした後に発生し始めました。以前はうまくいきました。コードの下キーボードが開くとツールバーが開くxamarinフォーム

After xamarin forms update result

答えて

0

MainActivityの私の問題を解決しました。

参考:https://gist.github.com/jimmgarrido/e36033b26f01e8da091fd321d41d991a

protected override void OnCreate(Bundle bundle) 
    { 
     ToolbarResource = Resource.Layout.toolbar; 

     base.OnCreate(bundle); 

     //Remove the status bar underlay in API 21+ 
     if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) 
     { 
      Window.DecorView.SystemUiVisibility = 0; 
      var statusBarHeightInfo = typeof(FormsAppCompatActivity).GetField("_statusBarHeight", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); 
      statusBarHeightInfo.SetValue(this, 0); 
      Window.SetStatusBarColor(new Android.Graphics.Color(18, 52, 86, 255)); 
     } 


     global::Xamarin.Forms.Forms.Init(this, bundle); 
     LoadApplication(new App()); 

     App.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize); 
    } 
関連する問題