[英]how programmatically add imageview under other imageview
Hi I have custom adapter which add ti gridview image 嗨,我有添加ti gridview图像的自定义适配器
adapter code 适配器代码
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
if (convertView == null) { // if it's not recycled, initialize some attributes
imageView = new ImageView(mContext);
imageView.setLayoutParams(new GridView.LayoutParams((tools.getWidth(mContext) - 30) / 3, (tools.getWidth(mContext) - 30) / 3));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
// imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}
imageView.setImageBitmap(static_file[position]);
imageView.setTag(p[position]);
return imageView;
}
In minimap I have image 在小地图中,我有图像
Help me please how I can programmatically add 2-rd image in 1-st 请帮助我如何以编程方式在1st中添加2rd图像
Use a custom layout, 使用自定义布局,
<RelativeLayout>
<ImageView> containing the image you want
<ImageView> the 2nd image having centerInParent=true
</RelativeLayout>
Refer to this Custom Adapter for List View 有关列表视图,请参考此自定义适配器
There is no way simply because your "transparent background" isn't transparent at all. 不能仅仅因为您的“透明背景”根本就不透明。 It's just a part of the image, you should remove it as if it was white color, i've made it for, download this image and use it
它只是图像的一部分,您应该将其删除,就好像它是白色的一样,我已将其制成,下载并使用该图像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.