diff --git a/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs b/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs index 2a1fa4e..5a3b3e5 100644 --- a/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs +++ b/Runtime/FlipPage/XericFlipPageIndexVesselBase.cs @@ -169,7 +169,10 @@ namespace XericUI.FlipPage { base.Start(); - FlipPage(currentPageIndex); + // 一页都还没有时不要翻(页通常是运行期才加进来的):原来会走一遍 + // “索引0下的节点不存在(总数0页)” 并报一条 Error,启动日志里不该有它。 + if (TotalPageCount > 0) + FlipPage(currentPageIndex); } protected override void OnDestroy() diff --git a/Runtime/OverrideLayout/XericScrollRect.cs b/Runtime/OverrideLayout/XericScrollRect.cs index 8492b51..277cc04 100644 --- a/Runtime/OverrideLayout/XericScrollRect.cs +++ b/Runtime/OverrideLayout/XericScrollRect.cs @@ -248,7 +248,11 @@ namespace XericUI.OverrideLayout protected override void Start() { base.Start(); - childrenPool.Initialize(); + // childrenPool 鏄繖涓彃浠跺悗鏉ュ姞鐨勬牸锛氳�侀鍒朵綋閲屾牴鏈病鏈夎繖涓�椤癸紙鍔犺浇鍚庢槸绌烘睜锛夛紝 + // 鏃犳潯浠� Initialize 浼氬湪 Start 閲屾姏 ArgumentNullException銆傛病閰嶉鍒朵綋灏辫烦杩団�斺�� + // 涓嶇敤瀵硅薄姹犵殑婊氬姩鍒楄〃鐓у父婊氬姩锛屽彧鏄病鏈夋睜鍖栧瓙椤广�� + if (childrenPool != null && childrenPool.Prefab != null) + childrenPool.Initialize(); } protected override void SetContentAnchoredPosition(Vector2 position)