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
Post a Comment