简体   繁体   English

为什么多点触控不适用于我的图像按钮?

[英]Why isn't multi-touch working for my imagebuttons?

I'm using imagebuttons that play sounds using SoundPool. 我正在使用使用SoundPool播放声音的图像按钮。 Here is example code of one of the imagebuttons: 这是图像按钮之一的示例代码:

ImageButton Button1 = (ImageButton)findViewById(R.id.sound); ImageButton Button1 =(ImageButton)findViewById(R.id.sound); Button1.setOnTouchListener(new OnTouchListener() { Button1.setOnTouchListener(new OnTouchListener(){

        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_DOWN ) {
                mSoundManager.playSound(1);
                return false;
            }

            return false;
        }
    });

For some reason, it doesn't allow you to click multiple buttons at the same time. 由于某些原因,它不允许您同时单击多个按钮。 Is it because I'm building for 1.6 SDK? 是因为我要开发1.6 SDK吗?

Thanks! 谢谢!

why aren't you using onClickListener?????? 你为什么不使用onClickListener ??????

    ImageButton t = new ImageButton(this);
    t.setOnClickListener(clickListener);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM