1

问题:我为ImageView设置ImageBitmap后,焦点重置到左上角的小部件,为什么?

说明:我使用 FragmentActivity+Fragment 作为选项卡。在几个片段之一中,我使用 Gallery + ImageView 进行图像浏览。选择缩略图时,原始图像显示在 ImageView 中,如果我触摸缩略图,它可以正常工作,但是如果我通过键盘切换焦点,它不会,当我通过键盘将焦点切换到下一个缩略图时,原始图像闪烁,然后焦点重置到左上角的小部件,导致选项卡切换,另一个片段替换图像浏览片段。

如果我只是在图库中切换焦点而不更改原始图像,则不会完成重置。

// These two listener works for gesture and keyboard operation seperately
gallery.setOnItemClickListener(new GalleryItemClickListener());
gallery.setOnItemSelectedListener(new GalleryItemFocusListener());



// and then find out original image and show
currentBitmap = BitmapUtils.queryImageByThumbnailId(Home.this,
                        application.getThumbnailList().get(index));
currentImage.setImageBitmap(currentBitmap);
4

0 回答 0