在Android中,默认情况下ImageView是一个矩形.如何在ImageView中将其设置为圆角矩形(将我的Bitmap的所有4个角切掉为圆角矩形)?
android rounded-corners imageview android-image android-imageview
我想做那样的事.

这是一个列表视图行,其中包含名称和用户图像.
我做了一些搜索并完成了图像循环,但不是完美的解决方案.任何帮助都会帮助我.
我的代码添加到Image Loader类
public Bitmap processBitmap(Bitmap bitmap) {
int pixels = 0;
if (mRound == 0)
pixels = 120;
else
pixels = mRound;
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
final float roundPx = pixels;
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, …Run Code Online (Sandbox Code Playgroud) 我有一个ListView,其中ImageView的图像在ImageView从服务器获取后动态加载.现在,我希望这些任意大小的图像都适合圆形框架,怎么做?这是我想要的示例图片

这是我的xml布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="75dp"
android:padding="3dp" >
<ImageView
android:id="@+id/img"
android:layout_width="75dp"
android:layout_height="75dp"
android:scaleType="fitCenter"
/>
<TextView
android:id="@+id/name"
android:layout_width="208dp"
android:layout_height="75dp"
android:paddingLeft="15dp"
android:paddingTop="15dp" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_gravity="center"
android:src="@drawable/ash_arrow" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我怎样才能展现ImageView圆角?