[英]Xamarin Forms - iOS Input fields does not adjust position automatically as keyboard appears with contents inside ScrollView
I am developing a Xamarin Forms in which I have a input entry section to end of the page. 我正在开发Xamarin表单,其中在页面末尾有一个输入项。
My Layout is like the following, 我的布局如下所示,
<ScrollView>
<StackLayout>
<Grid>
</Grid>
<Grid>
</Grid>
<Grid>
</Grid>
<StackLayout>
<Entry/>
<Entry/>
<Entry/>
<Editor/>
</StackLayout>
<StackLayout>
</ScrollView>
I have done scroll adjustment when the Entry/Editor Fields come to Focus. 当输入/编辑器字段成为焦点时,我已经完成了滚动调整。 However, the entry fields are not completely getting visible as the Keyboard overlays.
但是,随着键盘的覆盖,输入字段并不完全可见。 In Android it is working fine, but not in iOS.
在Android中,它工作正常,但在iOS中,则无法正常工作。
If the user manually scrolls down, it is fine. 如果用户手动向下滚动,则可以。 How can I animate the scroll automatically to show the Entry/Editor fields in position as the Keyboard gets visible?
如何在键盘可见的情况下自动设置滚动动画以显示“输入/编辑器”字段?
Any help on this much appreciated. 任何帮助对此表示赞赏。
You could install Xamarin.IQKeyboardManager from Nuget on your iOS project. 您可以在您的iOS项目中从Nuget安装Xamarin.IQKeyboardManager 。 Then enable it in the AppDelegate :
然后在AppDelegate中启用它:
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
IQKeyboardManager.SharedManager.Enable = true;
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.