本文介绍了滑行圆形图像被裁剪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用滑行制作圆形的imageview ...我遵循了本教程如何使用Glide库对图像进行四舍五入?但我的图像总是被裁剪掉顶部和底部
I'm trying to make a circular imageview using glide...I followed this tutorial How to round an image with Glide library? but my image always get the top and bottom cropped
我尝试更改imageview的尺寸,但没有任何变化,总是裁剪且比例相同
i tried to change imageview dimensions but nothing changes, always cropped and same ratio
我在做什么错
Glide.with(this).load(MasterFacade.getFacade().getLocalUser().getProfilePicUrl()).apply(RequestOptions.centerCropTransform()).into((ImageView) findViewById(R.id.profileImageView));
和布局
<ImageView
android:id="@+id/profileImageView"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:scaleType="fitXY" />
推荐答案
<ImageView
android:id="@+id/profileImageView"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
android:layout_margin="15dp"
android:scaleType="fitXY" />
问题是其他视图重叠了,应该可以解决您的问题
The problem is that is overlaping the other views, with a margin it should solve your problem
这篇关于滑行圆形图像被裁剪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!