淡化动画Fade animations

使用淡化动画将项目引入或引出视图。Use fade animations to bring items into a view or to take items out of a view. 两个常见淡化动画是淡入和淡出。The two common fade animations are fade-in and fade-out.

重要 APIFadeInThemeAnimation 类FadeOutThemeAnimation 类Important APIs : FadeInThemeAnimation class, FadeOutThemeAnimation class

应做事项和禁止事项Do's and don'ts

  • 当你的应用在不相关的元素或有大量文本的元素之间过渡时,先使用淡出,然后使用淡入。When your app transitions between unrelated or text-heavy elements, use a fade-out followed by a fade-in. 这可让传出对象在传入对象显示之前完全消失。This allows the outgoing object to completely disappear before the incoming object is visible.
  • 如果元素的大小保持不变并且你希望用户感觉他们在查看相同的项,则在传出元素之上淡入一个或多个传入元素。Fade in the incoming element or elements on top of the outgoing elements if the size of the elements remains constant, and if you want the user to feel that they're looking at the same item. 淡入完成后,可以删除传出项目。Once the fade-in is complete, the outgoing item can be removed. 这只是在传出项被传入项完全覆盖时的一个可行选项。This is only a viable option when the outgoing item will be completely covered by the incoming item.
  • 避免使用淡化动画添加或删除列表中的项。Avoid fade animations to add or delete items in a list. 相反,请使用为该目的创建的列表动画。Instead, use the list animations created for that purpose.
  • 避免使用淡化动画更改整个页面内容。Avoid fade animations to change the entire contents of a page. 相反,请使用为该目的创建的页面过渡动画。Instead, use the page transition animations created for that purpose.
  • 淡出是用于删除元素的不明显的方法。Fade-out is a subtle way to remove an element.