vendredi 6 mars 2015

Android ImageView shows image smaller than it is



at the beginning my imageview shows the right size of my image (90x90px). But when I am changing the image the imageview shows the image in another size (it still says my bitmap object is 90x90px large)


Before: http://ift.tt/1wcn55C


After: http://ift.tt/1G8T9Yn


XML:



<ImageView
android:id="@+id/iv_icon"
android:src="@drawable/siplaceholder"
android:scaleType="fitXY"
app:layout_row="0"
app:layout_rowSpan="3"
app:layout_column="0"/>


Code:



inputStream = getAssets().open("icons/" + "siplaceholder.jpg");
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
((ImageView) findViewById(R.id.iv_icon)).setImageBitmap(bitmap);


Please excuse my english but its not my native language.




Aucun commentaire:

Enregistrer un commentaire