android-画廊和衰落的边缘

android-画廊和衰落的边缘,第1张

概述我有一个有位图的画廊.这是代码://Bitmapsnoop=BitmapFactory.decodeResource(mContext.getResources(),mImageIds[position]);//i.setImageResource(mImageIds[position]);//i.setScaleType(ImageView.ScaleType.FIT_XY);BitmapFactory.Optionsopti

我有一个有位图的画廊.这是代码:

    // 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:我解决了一个边距问题.我将宽度添加30:i.setLayoutParams(new gallery.LayoutParams(wIDth 30,height)),但是转到下一页后,颜色仍然较浅.知道为什么吗?

解决方法:

请尝试以下 *** 作以停止图像重叠,从而消除问题:

gallery gallery= (gallery)findVIEwByID(R.ID.gallery);gallery.setHorizontalFadingEdgeEnabled(false);
总结

以上是内存溢出为你收集整理的android-画廊和衰落的边缘全部内容,希望文章能够帮你解决android-画廊和衰落的边缘所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1073446.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存