javascript - Transparent overlay in React Native -


i'm trying transparent overlay sliding down in app, pretty here (all/filter-by):

transparent slider

so far found react-native-slider , react-native-overlay. modified slider work top bottom, moves down listview well. if using react-native-overlay, overlay static , can't move it.

i added demo code original react-native tutorial in gist. when clicking button, content should stick, , menu should overlay. transparency not important right awesome.

what smartest solution?

the key listview not moving down, set positioning of overlay absolute. doing so, can set position , width/height of view manually , doesn't follow flexbox layout anymore. check out following short example. height of overlay fixed 360, can animate or make dynamic.

'use strict';  var react = require('react-native'); var dimensions = require('dimensions');  // can use make overlay fill entire width var { width, height } = dimensions.get('window');  var {   appregistry,   stylesheet,   text,   view, } = react;  var sampleapp = react.createclass({   render: function() {     return (       <view style={styles.container}>         <text style={styles.welcome}>           welcome react native playground!         </text>         <view style={[styles.overlay, { height: 360}]} />       </view>     );   } });  var styles = stylesheet.create({   container: {     flex: 1,     justifycontent: 'center',     alignitems: 'center',     backgroundcolor: '#f5fcff',   },   welcome: {     fontsize: 20,     textalign: 'center',     margin: 10,   },   // flex fill, position absolute,    // fixed left/top, , width set window width   overlay: {     flex: 1,     position: 'absolute',     left: 0,     top: 0,     opacity: 0.5,     backgroundcolor: 'black',     width: width   }   });  appregistry.registercomponent('sampleapp', () => sampleapp);  module.exports = sampleapp; 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -