listview 만들기

2682 단어 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); 

좋은 웹페이지 즐겨찾기