[問題] 圖片轉換
小弟目前有兩張圖片 ((圖片A 圖片B))
目前使用LayoutParams、param.setMargins語法去設定...
但這兩個語法得..點擊圖片才會由A變到B...
不知道有沒有其他方法可以...假使一個回合結束後((使用者點擊後))
圖片直接由A變到B...
Bundle ab = this.getIntent().getExtras();
String t2_apple = ab.getString("t_apple");
total = Integer.parseInt(t2_apple);
count = total;
for (int i = 0; i < total; i++) {
LayoutParams param = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
image[i] = new ImageView(this);
image[i].setImageResource(R.drawable.play);
param.setMargins((i / 10) * 55 + 10, (i % 10) * 70 + 20, 0, 0);// (i/2)
layout.addView(image[i], param);
image[i].setOnClickListener(this);
}
public void onClick(View v)
{
v.setSelected(true);
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 113.61.141.108
推
10/01 18:25, , 1F
10/01 18:25, 1F
→
10/01 18:26, , 2F
10/01 18:26, 2F
※ 編輯: closer1018 來自: 113.61.141.108 (10/01 23:24)
→
10/01 23:26, , 3F
10/01 23:26, 3F
推
10/02 02:23, , 4F
10/02 02:23, 4F
→
10/04 17:47, , 5F
10/04 17:47, 5F