我有一个drawbale,我想为这个gridView 中的每个图像将它放在一个gridView 中。我的drawable就像一个正方形,但在边缘填充。因此,当我将此可绘制对象设置为图像的背景时,图像将覆盖我不需要的背景。我需要这个drawable在图像的前面而不是在后面。
我的代码如下所示:在此处输入代码
public class ComponentAlbums extends LinearLayout
{
public ClassImageLoader imageLoader;
public ComponentAlbums(Activity activity,Context context,WallPaperHD_Album item)
{
super(context);
imageLoader = new ClassImageLoader(activity);
setOrientation(LinearLayout.HORIZONTAL);
setBackgroundColor(Color.TRANSPARENT);
LinearLayout.LayoutParams Params = new LinearLayout.LayoutParams(120, 120);
ImageView imageView = new ImageView(context);
Params.gravity = Gravity.CENTER;
imageView.setScaleType(ScaleType.FIT_XY);
imageView.setPadding(10, 10, 10, 10);
//imageView.setAdjustViewBounds(true);
imageView.setBackgroundResource(R.drawable.frame_all_albums);//this line of code iam using to set the drawable infront of the image.
请提供任何帮助。