Note that there are some explanatory texts on larger screens.

plurals
  1. PODrawable from Assets Layout
    primarykey
    data
    text
    <p>I have a ViewFlipper and I inflate the first View multiple times to get the same Layout in each child. </p> <p>I put some images in the assets folder which I want to load and put it each child of the ViewFlipper. </p> <p>My problem is that these images aren`t as big as the inflated ImageView. All images in the assets have the same size 450x450.</p> <p>Is it normal that the loaded pictures are scaled smaller, when they are loaded from the assets? Or is the problem somewhere else?</p> <p>I know that I can put the images in the drawable directory, but I want to have my images in the assets. </p> <pre><code>for(int i =0;i&lt; createArray();i++){ flipper.setDisplayedChild(i); ImageView pic = (ImageView) flipper.getCurrentView().findViewById(R.id.ImageView01); ImageView pic2 = (ImageView) flipper.getCurrentView().findViewById(R.id.ImageView02); try { Drawable d1 = Drawable.createFromStream(getAssets().open("product-overview"+File.separator+"psu"+File.separator+fileNames[i]+File.separator+"product_pic_full.png"), null); Drawable d2 = Drawable.createFromStream(getAssets().open("product-overview"+File.separator+"psu"+File.separator+fileNames[i]+File.separator+"product_pic_background.png"), null); pic.setImageDrawable(d1); pic2.setImageDrawable(d2); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } </code></pre> <p>As explanation: I load the pictures dynamically from assets. My assets folder has sub-folders because the overview is much better. I load them and every ViewFlipper- child gets his own picture : Frontside and Backside. Everything is working fine. But the images aren`t 450x450 as the pictures in assets.</p> <p>Maybe it`s not a good method to change the views. But it works for me. </p>
    singulars
    1. This table or related slice is empty.
    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.
    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