Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

keyboard hiding input controls both Android and ios platform

$
0
0

I have a Searchpage(ContentPage), that having some entry fields top level field can be visible with when device soft keyboard pop up comes but in middle that's overlapping with soft keyboard even though i used scroll view in that content page i will give my code template that will be helpful to give me a better solution.

    <StackLayout>
           // My header content
    </StackLayout>

    <ScrollView>
             <Grid>
                  <Grid.RowDefinitions>..... </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>... </Grid.ColumnDefinitions>

                 <StackLayout Grid.Row="0" Grid.Column="0">
                    //Some controls here
                </StackLayout>
                 <StackLayout Grid.Row="0" Grid.Column="0">
                     <StackLayout Orientation="Horizontal" >
                                  <Label Text="From Date" Style="{StaticResource SearchLabelStyle}"></Label>
                                  <DatePicker x:Name="FromDate" Style="{StaticResource DatePickerStyle}" Date="{Binding Filter.FromDate,                            Mode=TwoWay}" >
                                  </DatePicker>
                                </StackLayout>

                                <StackLayout Orientation="Horizontal">
                                  <Label Text="To Date" Style="{StaticResource SearchLabelStyle}"></Label>
                                  <DatePicker x:Name="ToDate" Style="{StaticResource DatePickerStyle}" Date="{Binding Filter.ToDate, Mode=TwoWay}">
                                  </DatePicker>
                                </StackLayout>

                                <StackLayout Orientation="Horizontal">
                                  <Label Text="Work Order No." Style="{StaticResource SearchLabelStyle}"></Label>
                                  <Entry Text="{Binding Filter.WorkOrderNo}" Style="{StaticResource SearchValueStyle}"></Entry>
                                </StackLayout>

                                <StackLayout Orientation="Horizontal">
                                  <Label Text="Service Request No." Style="{StaticResource SearchLabelStyle}"></Label>
                                  <Entry Text="{Binding Filter.RequestNo}" Style="{StaticResource SearchValueStyle}"></Entry>
                                </StackLayout>

                                <StackLayout Orientation="Horizontal">
                                  <Label Text="Asset No." Style="{StaticResource SearchLabelStyle}"></Label>
                                  <Entry Text="{Binding Filter.AssetNo}" Style="{StaticResource SearchValueStyle}"></Entry>
                                </StackLayout>

                                <StackLayout Orientation="Horizontal">
                                  <Label Text="Status" Style="{StaticResource SearchLabelStyle}"></Label>
                                  <customcontrols:BindablePicker Title="Select" x:Name="StatusPicker" Style="{StaticResource SearchValueBindablePickerStyle}" SelectedIndexChanged="Status_SelectedIndexChanged">
                                  </customcontrols:BindablePicker>
                                </StackLayout>
        // ~~This control fully overlapping by keyboard~~ :'(
                                <StackLayout Orientation="Horizontal">
                                  <Label Text="User Department" Style="{StaticResource SearchLabelStyle}"></Label>
                                  <Entry Text="{Binding Filter.UserDepartment}" Style="{StaticResource SearchValueStyle}"></Entry>
                                </StackLayout>
                </StackLayout>

            </Grid>
    </ScrollView>

     <Grid>
                  <Grid.RowDefinitions>..... </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>... </Grid.ColumnDefinitions>

            //  ----Here i used DataGrid with fixed height---
    </Grid>

From this i understood previously i used scroll view before my relative layout that time it was ok, when keyboard comes the scroll view will move over and also pointing input control highly visible. Now i changed layout as per requirement but even though i used scroll view that particular user entry portion it's not enabled while coming keyboard popup and input control hided/ overlapping by keyboard.

So give me some effective solution for both Android and IOSplaform.

It's highly appreciable and more useful for the Xamarin developers. :)

Thanks,
Vinoth


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>