开发者

Android Zoom Controls keep zooming in and will not stop

开发者 https://www.devze.com 2022-12-30 17:40 出处:网络
My zoom controls keep zooming in when I press the button, and will not stop, am I missing something? zoomControls = (ZoomControls) findViewById(R.id.zoom);

My zoom controls keep zooming in when I press the button, and will not stop, am I missing something?

zoomControls = (ZoomControls) findViewById(R.id.zoom);
        zoomControls.setOnZoomInClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                        mc.zoomIn();
                }
        });
        zoomControls.setOnZoomOutClickListener(new View.OnClickListener(开发者_如何学JAVA) {
                @Override
                public void onClick(View v) {
                        mc.zoomOut();
                }
        });


Taking an educated guess that mc is a MapController, perhaps calling zoomIn() on a MapController triggers the relevant OnClickListener as well. Try logging every time you are in your onClick() to see if you get a chain of log messages. If so, then you probably can't do what you're trying to do.

0

精彩评论

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

关注公众号