Xamarin Forms Android Keybord 不滚动列表 [英] Xamarin Forms Android Keybord does not scroll the list

查看:31
本文介绍了Xamarin Forms Android Keybord 不滚动列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Xamarin 表单的新手,我在 tableView 中定义了几个条目,用于使用 xamarin.forms 进行数据输入.我将它们包裹在滚动视图中,这样当键盘出现时,它们应该滚动.现在,问题是当键盘出现时,它会滚动到聚焦的条目,但所有下面的剩余条目/文本框仍然隐藏.我应该能够滚动直到我的列表结束,所以我可以轻松地编辑字段.对此的任何解决方案(我使用的是 Xamarin.Forms 1.4.4 版)

I'm new to Xamarin forms and I defined few Entry in a tableView for data entry purpose using xamarin.forms. I wrapped them into scroll view so that when keyboard appears, they should scroll.Now, the problem is when keybord appeard it scroll till the Entry which is focused but all below remaining entries/text-boxes remains hidden.I should be able to scroll till end of my list so i can easily edit the fields.Any solution for this (I'm using Xamarin.Forms version 1.4.4)

推荐答案

这是 ScrollView 的默认行为,它也发生在 iOS 上.

That is the default behavior of the ScrollView, it happens on iOS as well.

您可以使用 ContentPage 上的 LayoutChanged 事件来检测键盘何时将所有内容向上推,但当然还有许多其他事情也会引发该事件.

You can use the LayoutChanged event on the ContentPage to detect when the keyboard pushes everything up, but of course many other things raise that event as well.

您最好为每个平台使用自定义渲染器.

You might be better going with a custom renderer for each platform.

Android 使用键盘执行类似操作的示例如下:如何让键盘不覆盖我的 UI 而不是调整它的大小?

An example of an Android one doing similar things with a keyboard is here: How do I keep the keyboard from covering my UI instead of resizing it?

这篇关于Xamarin Forms Android Keybord 不滚动列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆