ES6

React Native FoldView 折叠效果

2017-05-26  本文已影响279人  时见疏星

https://commitocracy.com/implementing-foldview-in-react-native-e970011f98b8

git clone https://github.com/jmurzy/react-native-foldview

cd react-native-foldview/examples/Simple
npm install

npm run ios

quick update on the FoldView.js, make sure to clear cache and reload the app afterwards

const baseStyle = this.state.baseLayout ? {
      height: this.state.baseLayout.height,
    } : styles.base;

update to

const baseStyle = this.state.baseLayout ? {
      height: this.state.baseLayout.height,
      flex: 1
    } : styles.base;

有用的评论

Nice work, Jake!
I managed to create the same effect without the transform-origin property, but I don’t know if it can be applied to React Native.
Take a look: https://jsfiddle.net/melomario/bc2w31jo/1/

Thanks! I do have it on Exponent, but some of the Touchables aren’t responding as they should due to a pointerEvents bug in Exponent.
https://exp.host/@jmurzy/react-native-foldview-example-simple
Once, they fix the issue, I’ll also include the link in the README.

上一篇 下一篇

猜你喜欢

热点阅读