键盘出现时,scrollview不会自动滚动条目

时间:2017-01-30 10:21:27

标签: android ios xamarin.forms scrollview

我正在开发xamarin.forms便携式跨平台,它有两个项目android和iOS。

当我将光标保持在Entry上时,键盘打开但滚动视图不起作用

以下是我的代码

<Grid ColumnSpacing="0" RowSpacing="0" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Style="{StaticResource FillGrid}">
 <Grid.RowDefinitions>
    <RowDefinition Height="50"></RowDefinition>
  <RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<commonViews:CustomNavBar Grid.Row="0" Title="Add Journal"  IsImageVisible="False"/>
<ScrollView Grid.Row="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Orientation="Vertical">
  <Grid ColumnSpacing="0" RowSpacing="0">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*"></ColumnDefinition>
      <ColumnDefinition Width="*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"></RowDefinition>
      <RowDefinition Height="Auto"></RowDefinition>
      <RowDefinition Height="Auto"></RowDefinition>

    </Grid.RowDefinitions>
    <StackLayout Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource StackLayoutHeaderStyle}">
      <Label Style="{StaticResource LabelHeaderStyle}" Text="Customer"></Label>
    </StackLayout>
    <StackLayout Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource StackLayoutEntryStyle}">
      <Views:CustomCombobox x:Name="cmbItem" PlaceHolder="Select Customer" VerticalOptions="CenterAndExpand">
        <Label.GestureRecognizers>
          <TapGestureRecognizer
                  Tapped="OnItemTapGestureRecognizerTapped"/>
        </Label.GestureRecognizers>
      </Views:CustomCombobox>
    </StackLayout>
    <StackLayout Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource StackLayoutEntryStyle}">

  </Grid>
</ScrollView>
</Grid>
MainActivity.cs中的

    [Activity (
    Label = "App",
    Theme = "@style/AppTheme",
    Icon="@drawable/icon",
    MainLauncher = false, WindowSoftInputMode = SoftInput.AdjustPan)

请说明我错在哪里。

0 个答案:

没有答案