Home > react-nav-router > AppearStatus
AppearStatus variable
Nav 视图外观状态编码
由 NavStack 写入、NavView 消费。用于描述视图在过渡动画各阶段的样式/可见性状态。
取值约定: - 正数:动画「结束态」(transition 生效后的目标样式) - 负数:动画「开始态」(transition 生效前的初始样式) - 0 / 1:非动画稳态(分别对应 隐藏 / 显示)
方向语义需要结合"上一次 appearStatus"推断(从 0 出发 = 进入;从 1 出发 = 离开)。 具体语义参见下表:
| 值 | 含义 | |----|-----------------------------------------------------------| | 0 | 完全隐藏(display: none),不参与布局 | | 1 | 正常显示(无 transform / opacity 修饰) | | 2 | 淡入结束 / 淡出开始:opacity = 1 | | -2 | 淡入开始 / 淡出结束:opacity = 0 | | 3 | pop 新页结束 / push 旧页开始:居中、不透明 | | -3 | pop 新页开始 / push 旧页结束:左移 50%、透明 | | 4 | pop 旧页开始 / push 新页结束:居中、不透明 | | -4 | pop 旧页结束 / push 新页开始:右移 100%(屏幕外)、透明 |
Signature:
typescript
AppearStatus: {
readonly Hidden: 0;
readonly Normal: 1;
readonly FadeInEnd: 2;
readonly FadeInStart: -2;
readonly PopInEnd: 3;
readonly PushOutEnd: -3;
readonly PopOutStart: 4;
readonly PushInStart: -4;
}