如何在CropImageView中拉伸图片?

时间:2015-07-27 03:57:28

标签: android

我使用库com.edmodo.cropper.CropImageView 如何将图像设置为整个高度和宽度视图?

<com.edmodo.cropper.CropImageView xmlns:custom="http://schemas.android.com/apk/res-auto"
                                      android:id="@+id/imageCrop"
                                      android:layout_width="fill_parent"
                                      android:layout_height="fill_parent"
                                      android:layout_alignParentTop="true"
                                      android:layout_alignParentLeft="true"
                                      android:layout_alignParentStart="false"
                                      android:layout_above="@+id/linearLayout5"/>

2 个答案:

答案 0 :(得分:1)

试试这个示例Git项目。Super easy component for Android to crop an image。我希望它可以帮助你。

答案 1 :(得分:0)

您需要将scaleType设置为fitxy,如下所示

android:scaleType="fitXY"