美文网首页代码片段分享
xamarin forms 输入法弹框遮挡住输入框或部分UI,不

xamarin forms 输入法弹框遮挡住输入框或部分UI,不

作者: 花艺荣 | 来源:发表于2019-08-12 18:11 被阅读0次

先解决Android上的:
在登录注册页面,往往有多个输入框和提交Button,当点击某些输入框时,输入法弹框弹出,
但页面不能滑动,造成下面输入框或button或其它view不能显示,仅管使用了ScrollView。
针对于Android 平台上,添加下面代码:
Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);

public partial class App : Xamarin.Forms.Application
    {
        public App()
        {
           // NativeAPIUtil.Instance.SetFullScreen();
            NativeAPIUtil.Instance.SetOritation(1);
            InitializeComponent();
            Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust.Resize);
            switch (Device.RuntimePlatform)
            {
                case Device.Android:

                    MainPage = new LoginPage();
                    break;
                case Device.iOS:
                case Device.UWP:
                case Device.macOS:
                default:   
                    MainPage = new SplashPage(); // new NavigationPage(new SplashPage());SplashPage
                    break;
            } 

相关文章

网友评论

    本文标题:xamarin forms 输入法弹框遮挡住输入框或部分UI,不

    本文链接:https://www.haomeiwen.com/subject/gafpjctx.html