加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Cocos scrollview

发布时间:2020-12-14 17:14:14 所属栏目:百科 来源:网络整理
导读:又一次被quick中的三套ui系统坑了,每次都找不到cocosstudio的scroll源码在哪里 本来想实现一个类似上拉刷新的功能 结果addEventListener 这个方法试了好多。。才找到 做一下标记吧,省得下次还是找半天 self.scroll = self.bg:getChildByName("rank_scroll"

又一次被quick中的三套ui系统坑了,每次都找不到cocosstudio的scroll源码在哪里

本来想实现一个类似上拉刷新的功能

结果addEventListener 这个方法试了好多。。才找到

做一下标记吧,省得下次还是找半天


 self.scroll = self.bg:getChildByName("rank_scroll")
 self.scroll:addEventListener(handler(self,self.scrollCallback))

function Rank:scrollCallback(sender,event)    
     
    if event == ccui.ScrollviewEventType.scrollToTop then
        print("scroll top")
    elseif event == ccui.ScrollviewEventType.scrollToBottom then
        print("scroll bottom")
    end

end


ccui.ScrollviewEventType = {
    scrollToTop =  0,scrollToBottom =  1,scrollToLeft = 2,scrollToRight = 3,scrolling = 4,bounceTop = 5,bounceBottom = 6,bounceLeft = 7,bounceRight = 8,}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读