简体   繁体   English

与 Lottie 动画元素互动

[英]Interact with Lottie animation elements

Using the Lottie Android library, is it possibly to let the user interact with elements of the animation that is being played?使用Lottie Android库,是否有可能让用户与正在播放的动画元素进行交互?

Like, have a button in the animation (not a native button) and react to clicks on it?比如,在动画中有一个按钮(不是原生按钮)并对点击它做出反应?

The json file is interpreted and outputs svg's to the DOM.解析 json 文件并将 svg 输出到 DOM。 These can be assigned an eventhandler like any other element.这些可以像任何其他元素一样被分配一个事件处理程序。

From Bodymovin: name your layers in starting with a "."来自 Bodymovin:以“.”开头命名您的图层。 or a "#" and they will get exported with the name as a class or an id respectively.或“#”,它们将分别以名称作为类或 id 导出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM