我有一个 ExpandableListView 并且在 ViewGroup 方法中我有一个图像跨度设置为一些文本视图,如下所示:
String statusText = postsList.get(groupPosition).get(TAG_userStatus).substring(urlStr.length(), postsList.get(groupPosition).get(TAG_userStatus).length());
Bitmap bm = BitmapFactory.decodeFile(urlStr);//urlStr is the path to my image: /mnt/sdcard/1.jpg
Bitmap resized = Bitmap.createScaledBitmap(bm, 200, 200, true);
TextView userStatus1 = (TextView)v.findViewById( R.id.userStatus );
SpannableStringBuilder ssb = new SpannableStringBuilder(" "+statusText );
ImageSpan span = new ImageSpan(resized, ImageSpan.ALIGN_BOTTOM);
ssb.setSpan( span, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE );
userStatus1.setText( ssb, BufferType.SPANNABLE );
我需要能够单击图像并全屏显示。但我不知道如何使图像可点击。我读过类似的帖子,但对我没有用。我认为这是因为 expandableListView 但我不确定。我希望你能帮助我。谢谢!