Scrollview没有在Android上滚动

时间:2016-05-06 11:49:32

标签: c# android xamarin xamarin.forms

我的滚动视图不会在Android上滚动。

这是我正在使用的XAML。

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:SmartTenancy.CustomRenderer;assembly=SmartTenancy"
             x:Class="SmartTenancy.ProfilePage">
  <ContentPage.Content>
    <ScrollView Orientation="Vertical" VerticalOptions="FillAndExpand">
      <StackLayout Orientation="Vertical" VerticalOptions="FillAndExpand">
        <RelativeLayout x:name="firstnameField"
          VerticalOptions="FillAndExpand"
          HorizontalOptions="FillAndExpand">
          <Label x:Name="firstnameLabel" Text="FirstName:" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, 
                                        Property=Width,
                                        Factor=0}"/>
          <Entry x:Name="firstnameText" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, 
                                        Property=Width,
                                        Factor=0.5}"/>
        </RelativeLayout>
        <RelativeLayout x:name="lastnameField"
          VerticalOptions="Start"
          HorizontalOptions="FillAndExpand">
          <Label x:Name="lastnameLabel" Text="LastName:" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, 
                                        Property=Width,
                                        Factor=0}"/>
          <Entry x:Name="lastnameText" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, 
                                        Property=Width,
                                        Factor=0.5}"/>
<-- The above RelativeLayout repeats another 15ish times --!>
        </RelativeLayout>
      </StackLayout>
    </ScrollView>
  </ContentPage.Content>
</ContentPage>

我尝试了许多不同的方向变化,垂直选项。在scrollview和stackview上。

经过大量的搜索,我无法找出为什么这不会滚动。上述代码的变换似乎对其他人有效。

我只在android上测试过这个。

0 个答案:

没有答案