单击输入字段时,它应该打开键盘,而我的键盘没有打开

时间:2019-07-15 07:50:28

标签: xaml xamarin xamarin.forms

在我的代码中,当单击输入字段时,它应该打开键盘,但我的一个键盘没有打开,并且当我多次单击它时,它会打开。这是我的源代码。所以在这里我附上了我的代码

  <Grid Grid.Row="0" Padding="20" x:Name="searchbar">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="400" />
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="25" />
      <RowDefinition Height="25" />
      <RowDefinition Height="50" />
      <RowDefinition Height="60" />
      <RowDefinition Height="60" />
    </Grid.RowDefinitions>
    <Label Grid.Row="0" Grid.Column="0" Text="Care of User - Profile" FontAttributes="Bold" TextColor="Black" />
    <Label Grid.Row="1" Grid.Column="0" Text="Enter the details of the person that the connection will be in care of." FontSize="Small" TextColor="#757575" />
    <BoxView Grid.Row="2" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="2" BackgroundColor="White" CornerRadius="5" Margin="0,0,0,20">
      <BoxView.Effects>
        <effects:ShadowEffect />
      </BoxView.Effects>
    </BoxView>
    <Picker Margin="15,10,0,0" Grid.Row="2" FontSize="Small" Grid.Column="0" TextColor="#757575" WidthRequest="180" HorizontalOptions="Start" x:Name="pickerReference" SelectedIndexChanged="pickerReference_SelectedIndexChanged">
      <Picker.ItemsSource>
        <x:Array Type="{x:Type x:String}">
          <x:String>Connection Reference</x:String>
          <x:String>Customer Reference</x:String>
        </x:Array>
      </Picker.ItemsSource>
      <Picker.SelectedIndex>0</Picker.SelectedIndex>
      <Picker.Effects>
        <effects:DropdownEffect />
      </Picker.Effects>
    </Picker>
    <Picker Margin="5,10,0,0" Grid.Row="2" FontSize="Small" Grid.Column="0" TextColor="#757575" WidthRequest="100" HorizontalOptions="End" x:Name="pickerUserIdentityType" SelectedIndexChanged="pickerUserIdentityType_SelectedIndexChanged">
      <Picker.ItemsSource>
        <x:Array Type="{x:Type x:String}">
          <x:String>NIC</x:String>
          <x:String>Passport</x:String>
        </x:Array>
      </Picker.ItemsSource>
      <Picker.SelectedIndex>0</Picker.SelectedIndex>
      <Picker.Effects>
        <effects:DropdownEffect />
      </Picker.Effects>
    </Picker>
    <Label Grid.Row="3" Grid.Column="0" Text="Enter Mobile/ DTV/ Fixed number" FontSize="Small" TextColor="#757575" Margin="20,10,0,0" x:Name="label" />
    <Entry x:Name="searchEnt" Margin="15,20,65,0" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" FontSize="Medium" />
    <Button x:Name="searchBtn" Margin="0,20,15,0" WidthRequest="40" Grid.Row="3" Grid.Column="1" HorizontalOptions="End" CornerRadius="5" Image="search.png" Clicked="SearchBtn_Clicked"/>
  </Grid>

请帮助我。

0 个答案:

没有答案