【发布时间】:2021-08-07 20:35:25
【问题描述】:
谁能告诉我为什么这张图片没有填满屏幕? Android 模拟器上的“AspectFill”是否存在已知错误?
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="HelloWorld2.AbsoluteLayout_Exercise2">
<AbsoluteLayout>
<Image Source="AbsoluteLayout_Exercise2.jpeg" `Aspect="AspectFill"/>
</AbsoluteLayout>
</ContentPage>
【问题讨论】:
-
Aspect 指定图像数据将如何填充图像控件。如果希望 Image 控件填满屏幕,请使用 HorizontalOptions 和 VerticalOptions
-
谢谢杰森!这是我一直没有考虑到的那些时刻之一。发布后几分钟我自己解决了。
标签: c# xamarin xamarin.forms xamarin.android