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.
嘿,我有很多子视图,可以制作一些动画。
问题是当播放动画时,视图仍然会对触摸事件做出反应,这是我不想要的。
我想过在所有视图的顶部设置透明视图,在播放动画时可以看到
还有其他方法吗?
谢谢!
您可以在视图上添加一个透明布局(在 xml 宽度和高度填充父级中声明它)并在动画开始时使可点击为真,在动画结束时使可点击为假。
您可以使用“OnAnimationStart”/“OnAnimationEnd”并在那里定义触摸行为。