gridcell = (Button) row.findViewById(R.id.calendar_day_gridcell);
gridcell.setText("Day 1");
URL url = new URL("http://172.16.4.29:81/pht/2013/9/18/3027_2013_9_18_12_14_56_b.JPG");
Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
我该如何设置bitmap
bmp 图像到按钮网格单元背景图像?
您可以使用以下代码来做到这一点..
BitmapDrawable bdrawable = new BitmapDrawable(context.getResources(),bitmap);
然后只需使用以下函数设置位图
button.setBackground(bdrawable);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)