在页面加载时突出显示特定图像

时间:2013-11-05 11:12:26

标签: android android-imageview

我有三个活动,在我的第一个活动中我有2个图像视图,通过单击每个图像,它将导航到下一个活动。所有这三个活动都包含图像视图。现在我的问题是当点击导航到下一个活动时,默认图像会突出显示,而我想突出显示我选择的特定图像。帮助我实现这一目标。

2 个答案:

答案 0 :(得分:0)

尝试将setColorFilter设置为您的视图。您可以突出显示您的特定视图。

PorterDuffColorFilter setNewFilter = 
new PorterDuffColorFilter(Color.GREEN, PorterDuff.Mode.SRC_ATOP);

ImageView imgSelected = (ImageView)findViewById(R.id.myImage);
Drawable d = imgSelected.getBackground();

d.setColorFilter(setNewFilter)

// Remove the filter by setting it as null.

d.setColorFilter(null);

答案 1 :(得分:0)

最后我找到了ans ..我们需要将请求重点放在特定的图像上非常简单

img1.requestFocus();

靠近特定的onclick。希望这可以帮助某人: - )

相关问题