Note that there are some explanatory texts on larger screens.

plurals
  1. POGridview does not show all the picture, only a small part
    text
    copied!<p>I have the following <code>GridView</code>:</p> <pre><code>public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(context); imageView.setScaleType(ScaleType.CENTER_CROP); } else { imageView = (ImageView) convertView; } if (mTemplates.get(position).getResource() != 0) { LogService.log("", "zzzzzzzzzzzzzzzz======loaded from resource" + mTemplates.get(position).getResource() + "???????????" + mTemplates.size()); imageView.setImageResource(mTemplates.get(position).getResource()); } else { imageView.setImageDrawable(mTemplates.get(position).getDrawableThumbnail()); // imageView.setImageResource(mTemplates.get(0).getResource()); LogService.log("", "zzzzzzzzzzzzzzzz======loaded from drawable"); LogService.log("", "=========SIZE: " + mTemplates.size()); } return imageView; } </code></pre> <p>Now I have some elements that do not have resources in the Drawables, but instead in a folder on the sdcard, so I create a drawable from the source of this pictures, and try to load that drawable on the gridview:</p> <pre><code>imageView.setImageDrawable(mTemplates.get(position).getDrawableThumbnail()); </code></pre> <p>But its like the gridview does not recognise these, and if its on the same collumn with other pictures it is shown, but if its on another collumn (lower), it will only show 2-3mm of the picture (also doesn't recognise its position like its not therE). If I hardcode and use the first picture from Resources like this:</p> <pre><code>imageView.setImageResource(mTemplates.get(0).getResource()); </code></pre> <p>It all works, what could be the issue?</p>
 

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