...
Controller c = item.GetController("c1");
if (c.selectedPageId == "0")//出错
{
c.SetSelectedIndex(1);
}
else if (c.selectedPageId == "1")//出错
{
c.SetSelectedIndex(0);
}
...
c.selectedPageId在热更新ILRuntime中出错,用con.selectedIndex代替
...
if (con.selectedIndex == 0)
{
con.SetSelectedIndex(1);
}
else if (con.selectedIndex == 1)
{
con.SetSelectedIndex(0);
}
...

本文探讨了在ILRuntime环境下,c.selectedPageId属性在使用中出现错误的问题,以及如何通过将它替换为con.selectedIndex进行修复。通过示例代码展示了条件判断结构的优化,确保在热更新过程中正确切换页面索引。
3187

被折叠的 条评论
为什么被折叠?



