locked
iOS - keyboard overlapping entry RRS feed

  • Question

  • User369433 posted

    I was searching over the Internet but I have not found a working solution for my problem.

    FIRST SCREEN

    SECOND SCREEN

    As you can I have a simple layout with ListView, and below the ListView i have a fixed footer which is always visible. It does not scroll with the ListView.

    On iOS when I am tapping the entry the keyboard is overlapping the Entry. On Android this problem does not exist. How to solve that problem?

    Here is my XAML

    <StackLayout>
          <ListView>
            {{ A LOT OF DATA }}
                </ListView>
                <StackLayout "> <!-- Here is a footer -->
                    <BoxView HeightRequest="1" Color="Black"/>
                    <Grid VerticalOptions="CenterAndExpand" Margin="10,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                         <Label Grid.Column="0" Text="label" VerticalTextAlignment="Center" />
                         <Entry Grid.Column="1"/> <!-- This entry causes a problem -->
                         <Label Grid.Column="2" Text="xx" VerticalTextAlignment="Center" />
                        <Button Grid.Column="3" Text="button" />
                    </Grid>
                </StackLayout>
    </StackLayout>
    

    The difficult part is that as you can see my entry which causes a problem is not inside a ScrollView because I want it to be always visible.

    I saw some solutions which are working when your entire page is inside the ScrollView but this not my case.

    I will be really grateful for any help.

    Friday, March 15, 2019 4:18 PM

Answers

  • User369979 posted

    You could install Xamarin.IQKeyboardManager on your iOS project. Then enable it in the 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);
    }
    

    When you want to turn it off, make a dependency service to disable it on iOS project.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, March 18, 2019 9:52 AM

All replies

  • User369979 posted

    You could install Xamarin.IQKeyboardManager on your iOS project. Then enable it in the 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);
    }
    

    When you want to turn it off, make a dependency service to disable it on iOS project.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, March 18, 2019 9:52 AM
  • User369433 posted

    @LandLu Thank you so much. WORKS LIKE A CHARM!

    Monday, March 18, 2019 10:46 AM
  • User398952 posted

    Thank you! Was facing the same problem. It's funny how in Android this is default behaviour but requires this plugin for it to work with iOS.

    Friday, March 19, 2021 4:12 PM