且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xamarin Forms中的滚动编辑器进入视图

更新时间:2023-02-03 15:05:54

使用Xamarin.Forms自动滚动编辑器和条目,你通常只需要将你的View(在本例中为StackLayout)打包到ScrollView中:

To get auto scroll for Editors and Entries with Xamarin.Forms, you usually just have to pack your View, in this case the StackLayout, into a ScrollView:

<ScrollView>
    <StackLayout VerticalOptions="FillAndExpand">
        <Image x:Name="cameraImage" Source="camera.png" />
        <Label Text="Describe the image" />
        <Editor />
        <Button Text="Save" />
    </StackLayout>
</ScrollView>

这就是它应该如何工作,但截至今天(2014年6月),有一个错误阻止这个完全使用编辑器(它适用于条目)。这个问题已知并正在研究中。

That's how it's supposed to work, but as of today (June 2014) there's a bug preventing this to work fully with the Editor (it works well with Entries). The issue is known and is worked on.

[更新2014-11-20]该问题已得到解决,并将在下一个XF版本中提供1.3

[UPDATE 2014-11-20]The issue has been addressed, and will be available in the next -pre release of XF 1.3