[英]Why isn't multi-touch working for my imagebuttons?
我正在使用使用SoundPool播放聲音的圖像按鈕。 這是圖像按鈕之一的示例代碼:
ImageButton Button1 =(ImageButton)findViewById(R.id.sound); Button1.setOnTouchListener(new OnTouchListener(){
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN ) {
mSoundManager.playSound(1);
return false;
}
return false;
}
});
由於某些原因,它不允許您同時單擊多個按鈕。 是因為我要開發1.6 SDK嗎?
謝謝!
你為什么不使用onClickListener ??????
ImageButton t = new ImageButton(this);
t.setOnClickListener(clickListener);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.