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); 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM