相关疑难解决方法(0)

如何制作带圆角的ImageView?

在Android中,默认情况下ImageView是一个矩形.如何在ImageView中将其设置为圆角矩形(将我的Bitmap的所有4个角切掉为圆角矩形)?

android rounded-corners imageview android-image android-imageview

537
推荐指数
27
解决办法
42万
查看次数

如何使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)

android imageview

28
推荐指数
3
解决办法
6万
查看次数

如何使图像适合android中的圆形框架

我有一个ListView,其中ImageView的图像在ImageView从服务器获取后动态加载.现在,我希望这些任意大小的图像都适合圆形框架,怎么做?这是我想要的示例图片

在此输入图像描述

android bitmap imageview

25
推荐指数
3
解决办法
5万
查看次数

在android中绘制圆圈

如何使用android SDK在两点之间绘制圆圈?

android

8
推荐指数
2
解决办法
3万
查看次数

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圆角?

android android-layout android-imageview

2
推荐指数
1
解决办法
2万
查看次数