ビットマップがあるギャラリーがあります。これはコードです:
// Bitmap snoop = BitmapFactory.decodeResource(mContext.getResources(), mImageIds[position]);
// i.setImageResource(mImageIds[position]);
// i.setScaleType(ImageView.ScaleType.FIT_XY);
BitmapFactory.Options options = new BitmapFactory.Options();
// will results in a much smaller image than the original
Bitmap b = BitmapFactory.decodeFile("/sdcard/DinEgen/"+name.get(position), options);
Bitmap img = Bitmap.createScaledBitmap( b, width, height, true );
b.recycle();
i.setImageBitmap(img);
//i.setBackgroundResource(mGalleryItemBackground);
i.setGallery(g);
i.setLayoutParams(new Gallery.LayoutParams(width, height));
return i;
アプリケーションを起動すると、すべて問題ないように見えます。写真のように:
そして次のページに行くと、すべてが悪いように見えます:
色は薄めで左側は縁のようなもので発色が良いです。バックカラーも明るく、このエッジは右側にあります。ギャラリーで使用しました
android:fadingEdge="none" android:fadingEdgeLength="0px"
しかし、まだ機能しません。色が変化する理由と、次のページに移動したときにこのエッジが表示されるのはなぜですか? なぜこれが起こるのか考えていますか?
Edit1:マージンに関する1つの問題を解決します。width in: に 30 を追加します i.setLayoutParams(new Gallery.LayoutParams(width+30, height))
が、次のページに移動した後でも色が薄くなります。理由はありますか?