Note that there are some explanatory texts on larger screens.

plurals
  1. POImageView with wrap_content height shows very skinny / cropped photo instead of full height
    primarykey
    data
    text
    <p>I have a screen where the user can read an article (with large photo at the top.</p> <p>It's general structure is:</p> <pre><code>LinearLayout -&gt; ScrollView -&gt; LinearLayout -&gt; ImageViews,TextViews...etc </code></pre> <p>The ImageView I'm having problems with is the large image at the top (below the Article's title, but above it's text:</p> <pre><code> &lt;ImageView android:id="@+id/article_photo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/super_light_gray" android:scaleType="centerCrop" android:contentDescription="@string/articlePhoto" android:cropToPadding="true" android:layout_marginBottom="10dp" android:padding="1dp"/&gt; </code></pre> <p>The problem is, <strong>the photos appear, but are cropped vertically A LOT</strong> so that even vertical-oriented photos show up very skinny and wide. I assumed that "wrap_content" should make it the full height of the photo... but I'm obviously wrong :)</p> <p>How can I make the photo show up full width (already working), but also full height?</p> <p>I'm using the UniversalImageLoader to load the images:</p> <pre><code> if(lrgPhoto != null &amp;&amp; !lrgPhoto.filepath.equals("")) { imageLoader.displayImage( "http://img.mysite.com/processes/resize_android.php?image=" + lrgPhoto.filepath + "&amp;size=640&amp;quality=90", imageView, imgDisplayOptions ); imageView.setVisibility(View.VISIBLE); //show photo } else { imageView.setVisibility(View.GONE); //hide photo imageView.invalidate(); } </code></pre> <p><strong>Edit:</strong></p> <p>If I change 'scaleType' to 'fitXY', then the image shows correct dimensions without being cropped, but then it's not full-width. Is there a way I can have both full-width AND not-cropped strangely?</p> <p>It appears the "crop" is because it's using the original height of the image for the height, but it's enlarging the image to fit full-width...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload