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

时间:2019-06-24 17:50:59

标签: xamarin.forms xamarin.android xamarin.ios keyboard

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

  

我尝试使用Content.layout,但无法匹配键盘并一起搜索。是否可以使用弹出控件来解决此问题?

   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));
    }

Default listview

Enter Search Text

[2]: https://i.stack.imgur.com/FXNIF.png

1 个答案:

答案 0 :(得分:0)

对于ios,您可以使用此插件,将其添加到ios项目中。

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

对于android,请尝试在App.xaml中添加以下代码,新建App()

FixedChannelPool

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

相关问题