如何在 xamarin android 上填充全屏图像?

How to fill full screen of image on xamarin android?

 <FFImageLoading.Views.ImageViewAsync
            android:id="@+id/imgThumbail"
            android:layout_height="500dp"
            android:layout_width="500dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="10dp"
            android:layout_marginTop="10dp"
            android:layout_gravity="center_vertical" />

我不想设置 500dp 的宽度,500dp 的高度。 我想把图片设置成全屏如上图

将您的 500dp 更改为 fill_parent(或 wrap_content

  • wrap_content

该组件只想显示得足够大以仅包含其内容。

  • fill_parent

该组件希望显示与其父组件一样大,并填充剩余空间。

注意:fill_parent 在 API 级别 8)

中重命名为 match_parent

更改属性

android:layout_height="500dp"
android:layout_width="500dp"

android:layout_height="match_parent"
android:layout_width="match_parent"

android:layout_height="fill_parent"
android:layout_width="fill_parent"

对于API level= 8 对于低于 8