0
我想在顯示軟鍵盤時將工具欄保持在頂部。我嘗試了windowSoftInputMode的所有選項,但沒有工作。在將xamarin格式升級到2.3.4.247之後,這已經開始發生。之前它工作正常。當鍵盤打開時,工具欄上升xamarin形式
After xamarin forms update result
我想在顯示軟鍵盤時將工具欄保持在頂部。我嘗試了windowSoftInputMode的所有選項,但沒有工作。在將xamarin格式升級到2.3.4.247之後,這已經開始發生。之前它工作正常。當鍵盤打開時,工具欄上升xamarin形式
After xamarin forms update result
低於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);
}