小编use*_*602的帖子

Xamarin Forms 2.0 AppCompat安卓键盘模式

Xamarin我更新到版本4,Forms和2.0版本.在Android上,我使用AppCompat.

我有一个问题.以前,Android键盘导致调整大小视图.现在这不会发生.键盘出现在顶视图上.并且要隐藏所需的元素.

我试过了:

[Activity(WindowSoftInputMode = SoftInput.AdjustResize, Label = "Title", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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


            ToolbarResource = Resource.Layout.toolbar;
            TabLayoutResource = Resource.Layout.tabs;

            LoadApplication(new App());
            Window.DecorView.SetFitsSystemWindows(true);
        }
    }
Run Code Online (Sandbox Code Playgroud)

Daylight AppCompat已在本课程中完成:https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/

谢谢.

android-appcompat android-softkeyboard xamarin xamarin.forms

2
推荐指数
1
解决办法
1194
查看次数