Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何向列表视图添加过渡(从右到左)?我需要创建一个类别/子类别选择,并且我找到的所有示例都为每个 ListView 使用一个新活动。
您可以将每个 listViews 放在自己的片段中,甚至可以将两个 listViews 放在同一个活动中。如果两者都在它们自己的片段中,则有一个包含它们的容器 Activity。
让类别列表原始填充其共享视图容器的宽度,并让子类别列表与类别视图的右侧对齐(可能在屏幕外)
当您想要两个从类别切换到子类别时,使用 ScaleAnimation 将类别 listView 从全宽缩小到 0。当它缩小时,另一个视图将从右侧“滑入”。
您可以使用任何您想要的效果来自定义和控制它。