翻页/滚动列表:没有页、没有池配置时不再抛空引用
- 翻页:总页数为 0 时 FlipsPage 会去访问第 0 页的节点(没有),先判 TotalPageCount > 0。 - 滚动列表:childrenPool 是后来加的字段,老预制体里为空;无条件 Initialize 会在 Start 抛 ArgumentNullException,没配预制体就跳过(不池化照常滚动)。
This commit is contained in:
@@ -169,7 +169,10 @@ namespace XericUI.FlipPage
|
||||
{
|
||||
base.Start();
|
||||
|
||||
FlipPage(currentPageIndex);
|
||||
// 一页都还没有时不要翻(页通常是运行期才加进来的):原来会走一遍
|
||||
// “索引0下的节点不存在(总数0页)” 并报一条 Error,启动日志里不该有它。
|
||||
if (TotalPageCount > 0)
|
||||
FlipPage(currentPageIndex);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
|
||||
Reference in New Issue
Block a user