
Untitled
By: a guest on
Jun 27th, 2012 | syntax:
None | size: 0.74 KB | hits: 7 | expires: Never
Android: Having problems with stretching/scaling on an image button
ImageView img = (ImageButton) dialog.findViewById(R.id.fullsizeimage);
img.setScaleType(ImageView.ScaleType.CENTER_INSIDE); //Changing ScaleType here has no effect
img.setImageBitmap(useThisBitmap);
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageButton
android:id="@+id/fullsizeimage"
android:background="@null"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
/>
</RelativeLayout>