Open Mrluosheng opened 5 years ago
在项目里面有个UglyViewCacheStufferSampleActivity.java类,有段代码 mContext.setDanmakuStyle,下面有个布局文件layout_view_cache.xml 可以更改布局,并设置标签代码
里面的图片展示可以用 viewHolder.mIcon.setImageBitmap(getBitmap(image_url));这个方法 , public static Bitmap getBitmap(String url) { Bitmap bm = null; try { URL iconUrl = new URL(url); URLConnection conn = iconUrl.openConnection(); HttpURLConnection http = (HttpURLConnection) conn; int length = http.getContentLength(); conn.connect(); // 获得图像的字符流 InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is, length); bm = BitmapFactory.decodeStream(bis); bis.close(); is.close();// 关闭流 } catch (Exception e) { e.printStackTrace(); } return bm; }
问下这种Html标签格式的怎么弹幕怎么加载出来: