オブジェクトスタックの背景として自分自身を適応させる方法を教えてください.Layout?stacklayout xamarinフォームに画像を塗りつぶす方法pcl
<ContentPage.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="1*"></RowDefinition>
</Grid.RowDefinitions>
<StackLayout BackgroundColor="#FF1100" Grid.Row="0" Grid.Column="0" VerticalOptions="Fill" HorizontalOptions="Fill">
<Image Aspect="Fill" x:Name="backgroundImage"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}"/>
</StackLayout>
<StackLayout BackgroundColor="#FF7700" Grid.Row="1" Grid.Column="0" VerticalOptions="Fill" HorizontalOptions="Fill">
<!--<Image Aspect="Fill" x:Name="backgroundImage"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}"/>-->
</StackLayout>
</Grid>
このコードではどのような結果が表示されますか?あなたが見たもののスクリーンショットを共有し、あなたが望むものではないことを説明できますか?注:ここでのRelativeLayout制約は、これがStackLayoutであるため有効ではありません。 – therealjohn
長さや高さにかかわらず、画像がオブジェクトstackLayoutの全面をカバーするようになったのが結果です。それが可能だ ?画像がはっきりと裂けてはならない。 –