【问题标题】:android imageview display in bad qualityandroid imageview显示质量差
【发布时间】:2015-12-19 10:53:13
【问题描述】:

我尝试显示 3 张中等尺寸的图像。 问题是它们以低质量显示并且对 UI 造成了很大的损害,我在互联网上进行了检查,最好的解决方案是使用 Piccaso,但我想知道如何在没有第三方的情况下以全质量显示图像-图书馆? 我像这样加载图像:

<ImageView
        android:id="@+id/btnring"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/itayring1"

        />

我也试过这个:

Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.itayicon);
    b1.setImageBitmap(bb);

当我使用 Eclipse 时,我可以轻松加载图像。 Android Studio中也一定有办法, 谢谢。

【问题讨论】:

  • 可以直接使用 imageview.setImageDrawable(R.drawable.yourdrawble);
  • b1是Activity中定义的ImageView。

标签: android bitmap imageview appearance


【解决方案1】:

仅将图像放入 xhdpi 可绘制图像并尝试以下代码:

    <ImageView
    android:id="@+id/btnring"
    android:layout_height="50dp"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:adjustViewBounds="true"
    android:src="@drawable/itayring1"
    />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多