用好连续性,让你的产品更丝滑。 连续性指的是:界面状态变化时,用户点到的元素不会消失再重新出现,而是直接过渡成下一个状态,让人始终清楚自己从哪里来、现在在哪里。这次用 iOS 里几个常见的场景,完整演示一遍: - 导航:行标题延续为页面标题,原标题收为返回按钮;滚动时,标题收入顶栏 - 卡片:卡片展开为正文,图片延展为头图;下拉时,沿原路收回 - 播放器:迷你播放条展开为播放页,封面、标题与按钮各归其位 - 搜索:搜索框移至顶部,匹配项随输入上移,其余淡出 - 图表:数据卡片展开为图表,卡片中的小柱延续为图表的柱 - 菜单:菜单自按钮原位展开;新增项落入首位,其余依次后移 - 标签栏:选中胶囊先伸展,再落位 附一条 Prompt:它会先诊断你的产品,找出值得做连续性的地方,再给出具体的改造方案。完整 Prompt 见评论,可以直接复制。
枯白啃设计

图标设计师 / 设计工程师

Prompt(3/3) - Web: the View Transitions API with view-transition-name on the shared elements (same-document, and cross-document where pages are separate), with a plain update as the fallback. Otherwise FLIP: measure first, apply the change, measure last, animate the inverse with transforms (Motion's layout and layoutId do this; so do Svelte's flip and crossfade, and Vue's TransitionGroup). For router-driven pages, start the transition from the router's navigation hook. - iOS: SwiftUI matchedGeometryEffect for shared elements in one view, navigationTransition(.zoom(sourceID:in:)) with matchedTransitionSource on iOS 18 and later for pushes and sheets; UIKit preferredTransition = .zoom on iOS 18, or a custom UIViewControllerAnimatedTransitioning with UIViewPropertyAnimator for interruptible, gesture-driven ones. - Android: Compose SharedTransitionLayout with Modifier.sharedElement and sharedBounds, AnimatedContent, Modifier.animateItem for lists, and predictive back for gesture-driven returns; with Views, MaterialContainerTransform and shared element transitions. - Flutter: Hero for shared elements between routes, OpenContainer from the animations package for card to page, AnimatedList and implicit animations for layout changes. - Desktop apps: Electron and Tauri take the web route (Tauri uses the system WebView, so test View Transitions there and keep the fallback); native apps use the same ideas with their own animation tools.
登录并发表评论

评论 · 0