如何在列表视图上放置一些图像?

时间:2018-12-01 15:27:05

标签: android image listview parsing bitmap

public void done(byte[] data, ParseException e) {
                                if (e == null && data == null) {

                                    Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
                                    ImageView imageView = new ImageView(getApplicationContext());
                                    imageView.setLayoutParams(new ViewGroup.LayoutParams(
                                            ViewGroup.LayoutParams.MATCH_PARENT,
                                            ViewGroup.LayoutParams.WRAP_CONTENT ));
imageView.setImageBitmap(bitmap);

                                     linearLayout.addView(imageView);

                                     listView.setAdapter(arrayAdapter);

0 个答案:

没有答案