2016-04-29 84 views
0

如何在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" />

enter image description here 我不想设定宽度的500dp,500dp的高度。 我想像上面的图片那样设置全屏图像。

回答

1

更改500dpfill_parent(或wrap_content

  • wrap_content

组件只是想显示足够大,只附上其内容。

  • fill_parent

组件要显示大如其父,并在剩余的空间填充。

注:fill_parent更名为match_parent在API等级8)

+0

我试过你的方法,但图片很小。这张照片也只有500 px的宽度和高度。 –

+0

在API级别22中支持fill_parent? –

2

变化特性

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等级= 8低于8