开发者

Selectors using Buttons [closed]

开发者 https://www.devze.com 2023-04-12 06:18 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague开发者_开发问答, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, vague开发者_开发问答, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I am Having 2 images and single button. By clicking on the button images need to be loaded by using selectors?


use this coding

button.setOnClickListener(new View.OnClickListener()  {            
    public void onClick(View v)  {          

        Drawable d1 = iv1.getDrawable();   
        Drawable d2 = iv2.getDrawable();   
        iv1.setImageDrawable(d2);
        iv2.setImageDrawable(d1);                            
    }                
  }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号