当它离开屏幕时,将 View 的 alpha 设置为 0 有什么意义?

What's the point of setting View's alpha to 0 when it's off the screen?

在许多 ViewPager's examples 中,当页面滑出屏幕时将页面的 alpha 设置为 0,例如:

if (position < -1) { // [-Infinity,-1)
    // This page is way off-screen to the left.
    view.setAlpha(0f);
}

我不明白这样做有什么意义。

就文档而言,这是因为他们将其用于动画。

如果您想制作任何类型的 fadein/zoomin 动画,您可能希望从完全不可见的页面开始制作动画。