javascript - react-native:Show spinner at the center of the screen -


i want show spinner @ center of screen.i used alignitems, justifycontent , flex there no change in position use margintop correct positioning.why there no change on use of alignitems,justifycontent , flex?

here m using spinner.

 return (   <view style={style.spinnerstyle}>   <spinner size ="large" />   </view>  );  const style = { spinnerstyle: {   flex: 1,   margintop:240 } }; 

spinner.js

  import react 'react';   import {view,activityindicator} 'react-native';    const spinner = ({size}) => {   return (   <view style = {styles.spinnerstyle}>   <activityindicator size={size || 'large'} />   </view>   );  };  const styles = { spinnerstyle: { flex: 1, justifycontent: 'center', alignitems:'center'  }  };  export { spinner }; 

can please try following:

where using spinner

spinnerstyle: {     flex: 1,     margintop:240,     justifycontent: 'center',     alignitems:'center' } 

in spinner

spinnerstyle: {     flex: 1     alignself:'center' } 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -