Bug 41474 - Using Stacklayout, inside ScrollView, with VerticalOptions set to CenterAndExpand works in Android but not in Windows
Summary: Using Stacklayout, inside ScrollView, with VerticalOptions set to CenterAndEx...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.0
Hardware: PC Windows
: Normal critical
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-03 00:43 UTC by Atul Chaudhary
Modified: 2017-06-12 21:48 UTC (History)
4 users (show)

Tags: Windows ac
Is this bug a regression?: ---
Last known good build:


Attachments
Repro project (4.29 MB, application/x-zip-compressed)
2016-07-08 15:50 UTC, E.Z. Hart [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 41474 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Atul Chaudhary 2016-06-03 00:43:44 UTC
# Steps to reproduce
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="SharePost.Views.MainPage">
  <ScrollView x:Name="scrollView">
    <StackLayout Orientation="Vertical" VerticalOptions="CenterAndExpand" 
                 Padding="20" Spacing="10">
      <Entry x:Name="enEmail" Placeholder="Email"></Entry>
      <Entry x:Name="enPassword" IsPassword="True" Placeholder="Password"></Entry>
      <Button Text="Login" Clicked="OnClicked_btnLogin" x:Name="btnLogin"></Button>
      <Button Text="Register" Clicked="OnClicked_btnRegister" x:Name="btnRegister"></Button>
    </StackLayout>
  </ScrollView>
  </ContentPage>

# Expected behavior
Scrollable center vertical aligned stacklayouit controls for Android and Windows

# Actual behavior
 But it is working only for Android at the moment. When I take out the scrollview it works in both but then clicking on entry field brings the andoid keyboard on top of entry field and my form doesn't scroll

# Supplemental info (logs, images, videos)


# Test environment (full version information)
Comment 1 E.Z. Hart [MSFT] 2016-06-06 20:03:12 UTC
(In reply to Atul Chaudhary from comment #0)

>   <ScrollView x:Name="scrollView">

Does changing this line to:

<ScrollView x:Name="scrollView" VerticalOptions="CenterAndExpand">

Fix your issue?
Comment 2 Atul Chaudhary 2016-06-06 22:20:42 UTC
If I set <ScrollView x:Name="scrollView" VerticalOptions="CenterAndExpand">. It works but when you click on Entry the android keyboard comes on top of my entry wihch is not what I am expecting and therefor can't use it. :(
Comment 3 E.Z. Hart [MSFT] 2016-07-08 15:50:38 UTC
Created attachment 16614 [details]
Repro project
Comment 4 E.Z. Hart [MSFT] 2016-07-08 15:51:14 UTC
The ScrollView layout behavior is inconsistent between Android, iOS, and Windows Phone. 

On Android and iOS, the attached repro project will display the form vertically centered. When focusing the Entry controls on small enough screens, the controls will be scolled vertically so as not to be covered by the on-screen keyboard. 

On Windows Phone, the attached project will display the form at the top of the screen, which is inconsistent with the other platforms.

This behavior is still occurring on 2.3.0.107.