我在Xamarin应用程序中具有以下代码结构。
<StackLayout>
<Entry Text="XYZ"/>
<ScrollView>
<StackLayout VerticalOptions="Start">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<BoxView HeightRequest="1" BackgroundColor="Black"/>
<Entry Grid.Row="1" Text="ABCD" VerticalOptions="Center"/>
<BoxView Grid.Row="2" HeightRequest="1" BackgroundColor="Aqua"/>
<BoxView Grid.Row="3" HeightRequest="1" BackgroundColor="Blue"/>
<Label Grid.Row="4" Text="12" TextColor="Red" VerticalOptions="Start"/>
</Grid>
</StackLayout>
</ScrollView>
</StackLayout>
输入文本“ ABCD”未在UWP中显示,但在android中工作正常。
参见:https://github.com/xamarin/Xamarin.Forms/issues/10137
尝试移除外部ScrollView。为我修复了此问题(但如果不重新设计UX,则无法使用长格式)。