I'm working on an Android application that needs to download an image and display it inside an image view. The Bitmap is passed to the main java file and added to the image view like this:
comic = (ImageView) findViewById(R.id.comic);
comic.setImageBitmap(c.getImageBitmap());
This works, except that the left side of the image disappears off the screen. The ImageView is in a ScrollView and the scroll view maintains the correct size. This means that there is black space to the right in the ScrollView and the image is cut off to the left.
The XML for the ImageView is this:
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent">
<HorizontalScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView android:id="@+id/comic" android:layout_height="fill_parent"
android:layout_width="fill_parent" android:layout_gravity="center"
android:src="@drawable/xkcdlogo" />
</HorizontalScrollView>
</ScrollView>
Any idea why my image is being cut off?
Thanks!