Xamarin 9补丁图像无法正确缩放

时间:2017-08-29 06:22:57

标签: image xaml xamarin nine-patch

我正在尝试使用9补丁图像作为标签的背景。我的图像有两个圆角,我想保持圆角半径不变,无论是否拉伸。

我使用RelativeLayout将背景图像定位在前景标签后面。我想将背景图像拉伸到RelativeLayout的高度和宽度。

<RelativeLayout Padding="15">
    <Image Aspect="Fill" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}" Source="panel_header" />
    <Label Margin="15" Text="{ Binding CategoryTitle }" />
</RelativeLayout>

图像正在拉伸以填充Android模拟器中父版面的宽度和高度,但是,它不符合9个补丁约束 - 它会像整个标准图像那样扭曲整个图像。

可以找到我的9个补丁图像here。我错过了什么吗?

0 个答案:

没有答案
相关问题