去掉CCListView中的默认的网格线

最近在用cocos2d-x做一个电子书的项目,需要用到CCListView,可以CCListView中的每个cell都会有一条网格线,影响美观,所有要把它去掉。

后来发现在CCListViewCell.cpp中的draw函数,中,注释掉一段代码即可。

 


void CCListViewCell::draw(void)
{
    CCLayerColor::draw();
    CCSize size = this->getContentSize();
    CCListView *owner = this->getOwner();
    if (CCListViewCellSeparatorStyleSingleLine == m_nSeparatorStyle)
    {
        glLineWidth(1.0f);
        ccDrawColor4B(m_separatorLineColor.r, m_separatorLineColor.g, m_separatorLineColor.b, 255);
  /*
        if (CCListViewModeHorizontal == owner->getMode())
        {
            ccDrawLine(CCPointMake(size.width, 0), CCPointMake(size.width, size.height));
        }
        else if (CCListViewModeVertical == owner->getMode())
        {
            ccDrawLine(CCPointMake(0, 0), CCPointMake(size.width, 0));
        }*/
    }

猜你喜欢

转载自blog.csdn.net/zhangjingyangguang/article/details/7877871