是否可以阻止第一个条目在 Xamarin Forms 中的 ScrollView 中获得焦点

use*_*er1 3 c# xamarin xamarin.forms uwp xamarin.uwp

在我的应用程序中,我有以下情况:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:conv="clr-namespace:NumericTextBoxTest.Converters;assembly=NumericTextBoxTest"
             xmlns:numericTextBox="clr-namespace:Syncfusion.SfNumericTextBox.XForms;assembly=Syncfusion.SfNumericTextBox.XForms"
             x:Class="NumericTextBoxTest.MainPage">
  <ScrollView>
    <StackLayout>    
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
      <Entry/>
    </StackLayout>

  </ScrollView>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)

现在,如果我点击空白底部(项下)即ScrollView第一EntryScrollView将获得焦点。

非常烦人,如果我在第一个更改值Entry并试图取消聚焦Entry以设置值。

是否有可能阻止这种行为?

Nic*_*SFT 7

现在,如果我单击底部(条目下方)的空白区域,即 ScrollView,则 ScrollView 中的第一个条目将获得焦点。

在 UWP 中,按照设计,当StackLayout被点击时,系统将搜索每个元素,StackLayout直到第一个可以关注的元素。作为解决此问题的变通方法,您可以在StackLayout.

<ScrollView>
        <StackLayout>
            <Button HeightRequest="0" WidthRequest="1" />
            <Entry  />
            ....
            <Entry />
        </StackLayout>
    </ScrollView>
Run Code Online (Sandbox Code Playgroud)

该按钮将集中在StackLayout被点击的时间。该Entry不会被关注