Xamarin 虚拟键盘与搜索组件重叠

Xamarin virtual keyboard overlaps search component

在我的 Xamarin 项目中,我有一个列表视图,底部有一个搜索框。当我输入搜索值时,虚拟键盘与搜索框重叠?

I tried to use Content.layout but I can't match the keyboard and search together Is there a way to fix this do I use a popup control?

   void InputFocused(object sender, EventArgs args){
        Content.LayoutTo(new Rectangle(0,-360, Content.Bounds.Width, Content.Bounds.Height));
    }

    void InputUnfocused(object sender, EventArgs args){
        Content.LayoutTo(new Rectangle(0,0, Content.Bounds.Width, Content.Bounds.Height));
    }

对于ios,你可以使用这个插件,添加到你的ios项目中。

https://github.com/paulpatarinski/Xamarin.Forms.Plugins/tree/master/KeyboardOverlap

对于android,尝试在App.xaml中添加如下代码, new App()

Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);

如果您仍然遇到此问题,请在此处提供模式代码,我会尝试在我这边重现您的问题。