"2.1rc0-x-2.1.4h"滚动层内子控件我设定
local imageView = tolua.cast(UIHelper:instance():seekWidgetByName(page, “imag_name”), “UIImageView”)
imageView:setVisible(false)后,控件是隐藏了。
但滚动层一旦滚动,被隐藏的控件,又出来了,是bug还是我用法不对?
滚动层的滚动时全部子控件进行了显示的判断,纯粹根据位置。
void UIScrollView::moveChildren(float offset)
for (int i=0;i<childrenCount;i++)
{
UIWidget* child = (UIWidget*)(arrayChildren->arr*);
child->setVisible(checkChildVisibleInParent(this, child));
}*
那我逻辑上的隐藏貌似是要自己来修改代码了
UIScrollView 的 moveChildren 中有:
ccArray* arrayChildren = m_pInnerContainer->getChildren()->data;
int childrenCount = arrayChildren->num;
for (int i=0;i<childrenCount;i++)
{
UIWidget* child = (UIWidget*)(arrayChildren->arr*);
child->setVisible(checkChildVisibleInParent(this, child));
}
child->setVisible(checkChildVisibleInParent(this, child)); 这行会根据子控件是否再显示区域内设置显示或隐藏*
直接把上边代码删掉就好了,显示可以根据剪裁区就好了
to pipu 有这个代码就会把自己逻辑上的隐藏冲掉的
UIScrollView 的 moveChildren 中有:
ccArray* arrayChildren = m_pInnerContainer->getChildren()->data;
int childrenCount = arrayChildren->num;
for (int i=0;i<childrenCount;i++)
{
UIWidget* child = (UIWidget*)(arrayChildren->arr*);
child->setVisible(checkChildVisibleInParent(this, child));
}
child->setVisible(checkChildVisibleInParent(this, child)); 这行会根据子控件是否再显示区域内设置显示或隐藏*