单击该图像时如何显示图像

时间:2014-05-26 09:52:06

标签: android onclicklistener

我想在点击该隐形图片时显示图片,我使用了setVisiblitysetAlpha的属性,但它仍无效。

ImageView finger_a, finger_b,finger_c, finger_d;    

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.layout_fingers);

    finger_a = (ImageView) findViewById(R.id.id_finger_A);
    finger_b = (ImageView) findViewById(R.id.id_finger_B);
    finger_c = (ImageView) findViewById(R.id.id_finger_c);
    finger_d = (ImageView) findViewById(R.id.id_finger_d);

    finger_a.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            finger_a.setVisibility(View.VISIBLE);

        }
    });

1 个答案:

答案 0 :(得分:0)

将其嵌入线性布局并在线性布局上设置onClickListener。我不认为启用了一个不可见的视图来点击。