horizo​​ntalscrollview onclicklistener不会被调用 [英] horizontalscrollview onclicklistener doesn't get called

查看:415
本文介绍了horizo​​ntalscrollview onclicklistener不会被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 horizo​​ntalscrollview 显示一些项目。该项目动态添加。我想显示一个警告框的 horizo​​ntalscrollview 被点击时。有可能会或可能不会在 horizo​​ntalscrollview 的任何项目,所以我想horizo​​ntalscrollview采取依次点击。但OnClickListener dosint得到所谓

i have horizontalscrollview displaying some items. The items are added dynamically. i want to show a alert box when the horizontalscrollview is clicked. there may or may not be any items in the horizontalscrollview so i want the horizontalscrollview to take the cick. But OnClickListener dosint get called

scrolv.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                slowAlert();
            }
        });

showAlert()不会被调用

showAlert() never gets called

推荐答案

有一件事你可以做的是对包含水平scrollsview视图点击侦听器。伴随着这一点,你可以有单纯疱疹病毒可点击藏汉每个视图。

One thing you could do is have the click listener on the view that contains the horizontal scrollsview. Along with this you could have each view in the HSV clickable aswell.

这篇关于horizo​​ntalscrollview onclicklistener不会被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆