图像文件是相同的。一旦它来自drawable
和一个来自file system
。
这是代码。
<ImageView
android:scaleType="fitEnd"
android:id="@+id/partner_logo"
android:layout_width="51dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="@string/parter_logo"
/>
我想动态设置合作伙伴标志,所以我从网络服务器加载 id 然后
设置为imageView.setImageBitmap(Bitmap bitmap);
使用 ImageResource 它看起来不错,正如我所期望的那样,但Bitmap
万一它太小了。
这里有图片比较
徽标(黑色箭头点)通过 设置setBitmap
。好像没有上档次
--
徽标(读取箭头点)是通过设置的setImageResource
。它看起来就像我想要的那样。
所以问题是为什么这里有区别?在位scaleType
图的情况下工作吗?