这是我当前的代码。

<?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:Quickies" x:Class="Quickies.QuickiesPage" BackgroundImage="Overview Image.png">
</ContentPage>

我可以在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:Quickies" x:Class="Quickies.QuickiesPage">
<Grid Padding="0">
    <Image
        Aspect="AspectFill"
        Source="Overview Image.png"
        RelativeLayout.WidthConstraint= "{ConstraintExpression Type=RelativeToParent, Property=Width}"
        RelativeLayout.HeightConstraint= "{ConstraintExpression Type=RelativeToParent, Property=Height}">
    </Image>
</Grid>
</ContentPage>

关于xaml - 有没有办法让我的背景图像均匀地填充内容页面? Xamarin.Forms,XAML,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42641606/

10-12 12:43
查看更多