0

如果我们使用 css,我们可以通过

.order {
  position: absolute;
  top: 50px;
  left: 50px;
  width: 75px;
  line-height: 75px;
  text-align:center;
  opacity: 1;
  background: green;
  color:#fff;
  border-radius:50%;
  -webkit-animation: bounce .3s infinite alternate;
  -moz-animation: bounce .3s infinite alternate;
  animation: bounce .3s infinite alternate;
}
@-webkit-keyframes bounce {
  to { -webkit-transform: scale(1.2); }
}
@-moz-keyframes bounce {
  to { -moz-transform: scale(1.2); }
}
@keyframes bounce {
  to { transform: scale(1.2); }

但问题是,react-native,我们不能使用类似的库web-kit,所以我想知道如何为按钮或更大的视图制作弹跳动画,如何在 react-native 应用程序中制作动画?

4

1 回答 1

1

React Native 也支持 React Spring。你应该在 React native 中使用 React Spring 来制作动画。我附上了反弹效果的例子。React Spring 的网站上还有其他效果,例如 Pulse、Hover 等。

你应该看看 React Spring Docs。 https://codesandbox.io/s/github/pmndrs/react-spring/tree/master/demo/src/sandboxes/css-keyframes

于 2021-09-10T23:39:01.460 回答