简体   繁体   English

Xamarin Forms-iOS输入字段不会自动调整位置,因为键盘出现在ScrollView中

[英]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.

相关问题 如何淡出 Xamarin Forms iOS 中的滚动视图的内容? - How do I fade out the contents of a scrollview in Xamarin Forms iOS? 在 Xamarin 表单 iOS 中,为滚动视图内的堆栈布局切换 IsVisible 无法正确更新 - Toggling IsVisible for an stacklayout inside scrollview does not update properly in Xamarin forms iOS 当页面已经在Xamarin Forms中具有滚动视图时,如何处理iOs键盘重叠条目 - How to deal with iOs keyboard overlapping entry when the page already has a scrollview in Xamarin Forms iOS ListView上下文操作不会在Xamarin表单中自动向后滑动 - iOS ListView Context Action does not swipe back automatically in Xamarin Forms Xamarin表格IOS - MKUserTrackingButton位置 - Xamarin Forms IOS - MKUserTrackingButton position Xamarin iOS-使scrollview的内容适合scrollview - Xamarin iOS - Fit scrollview's contents within the scrollview 如何在ListView出现在Xamarin Forms iOS中之前将ListView Scroll位置设置为底部? - How to set a ListView Scroll position to bottom, before ListView will appears in Xamarin Forms iOS? 如何在 Xamarin.Forms iOS 中实现“软键盘输入模式”并修复键盘重叠问题? - how to implement "Soft Keyboard Input Mode" and fix keyboard overlap issue in Xamarin.Forms iOS? iOS:UITextField 键盘和输入视图出现错误 position - iOS: UITextField keyboard and inputview appears at wrong position React Native-在键盘显示时调整滚动视图(iOS) - React Native - adjust scrollview as keyboard shows up (ios)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM