使用SimpleDraweView android在边界上剪切图像

使用SimpleDraweView android在边界上剪切图像,android,fresco,Android,Fresco,[![enter image description here][1][1]这是我的SimpleDraeeViwe,图像加载后图像未加载为完整,表示其覆盖图像视图的全部宽度,但图像在左右两侧被剪切。 还尝试了android:adjustViewBounds=true <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/image_mint" android:l

[![enter image description here][1][1]这是我的SimpleDraeeViwe,图像加载后图像未加载为完整,表示其覆盖图像视图的全部宽度,但图像在左右两侧被剪切。 还尝试了android:adjustViewBounds=true

<com.facebook.drawee.view.SimpleDraweeView
                android:id="@+id/image_mint"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="100dp"
                fresco:actualImageScaleType="fitCenter"
                fresco:viewAspectRatio="1.33"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true" />

试试这个

在您的情况下,必须设置正确的比例类型

<com.facebook.drawee.view.SimpleDraweeView
            android:id="@+id/image_mint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="100dp"
            fresco:actualImageScaleType="centerCrop"
            fresco:viewAspectRatio="1.33"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />


另请参见

尝试以编程方式进行设置,它正在工作

simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);

添加:Fresco.initialize(本);到你的应用程序类。是的,我已经初始化了,为什么它的老顶图像,否则它会崩溃的应用程序。我希望图像应该适合移动宽度,不应该,但从左和右。我不明白。你能解释一下你到底想做什么吗?检查我是否编辑了我的问题并更新了两幅图像,查看两幅图像之间的差异,一幅图像从左视图和右视图被剪切。一幅图像是从glide加载的,另一幅是由fresco加载的,但在fresco图像中被剪切。我导入xmlns:fresco=“”,然后scaleType开始工作。
simpleDraweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);