zoukankan      html  css  js  c++  java
  • lua 创建listview

        只要是新的聊天对象就创建一个新的listview
        local name = tolua.cast(UIHelper:seekWidgetByName(self.nameItem, "name"), "Label");
        local playerName = name:getStringValue();
        if nil == self.privateChatList[name:getTag()] then
            local ChatListView = ListView:create();
            if ChatListView == nil then
                print("===========ChatListView为空");
                return;
            end
            ChatListView:setSize(self.fullContent:getSize());
            --ChatListView:setAnchorPoint(ccp(0, 0));
            --ChatListView:setPosition(ccp(200, 200));
            ChatListView:setGravity(LISTVIEW_GRAVITY_LEFT);
            self.privateChatList[name:getTag()] = ChatListView;
            self.contentBg:addChild(ChatListView);
        end
        
        local customItem = Layout:create();
        customItem:setSize(CCSizeMake(self.fullContent:getSize().width, 50));
        customItem:setAnchorPoint(ccp(0, 0));
        self:initCustomItem( customItem );
        self.privateChatList[name:getTag()]:pushBackCustomItem(customItem); 
  • 相关阅读:
    1010考试T1
    P5631 最小mex生成树 分治 并查集
    P4366 [Code+#4]最短路 建图 最短路
    P1654 OSU! 期望概率DP
    7.26集训
    7.25集训
    7.23集训
    7.22集训
    7.21test
    7.12test
  • 原文地址:https://www.cnblogs.com/newlist/p/3589711.html
Copyright © 2011-2022 走看看