【问题标题】:How to Load multiple icons faster titanium appcelerator?如何更快地加载多个图标钛加速器?
【发布时间】:2013-05-27 18:11:54
【问题描述】:

目前我一直致力于创建聊天客户端支持表情图标的项目,但我面临一个问题,即在我的钛应用加速器项目中,我必须在视图中加载 > 100 个表情。钛应用加速器加载多张图片的速度非常慢,我不知道为什么会这样,有人可以建议我解决这个问题吗?

【问题讨论】:

    标签: titanium appcelerator


    【解决方案1】:

    假设你的 UI 实现可以支持它;加载包含所有约 100 个表情符号的单个图像,并将 touchend 事件侦听器添加到图像视图。偶数返回 x,y 坐标,然后您可以将其映射到选定的表情符号。

    var self = Ti.UI.createView({backgroundColor: '#666'});
    
    var emoticons = Ti.UI.createImageView({
        image: 'http://www.berkeley.edu/news2/2013/04/Finch300.jpg'
    });
    
    emoticons.addEventListener('touchend',function(e){
        alert('x: '+e.x+' y: '+e.y);
    })
    self.add(emoticons);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-26
      • 1970-01-01
      • 2014-11-02
      • 2015-10-25
      • 1970-01-01
      • 2011-10-10
      • 1970-01-01
      • 2012-12-02
      相关资源
      最近更新 更多