如何在Android中使图像跨度可点击?

时间:2013-07-01 20:36:22

标签: android bitmap expandablelistview spannable clickable-image

我有一个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但我不确定。我希望你能帮助我。谢谢!

0 个答案:

没有答案