items in center in native
var styles = StyleSheet.create({
content:{
flex:1,
flexDirection:'row',
alignItems:'center',
justifyContent:'center'
},
…
});
items in center in native
var styles = StyleSheet.create({
content:{
flex:1,
flexDirection:'row',
alignItems:'center',
justifyContent:'center'
},
…
});
react native layout animation
import React, {Component} from 'react';
import {View, Text, TouchableOpacity, Platform, UIManager} from 'react-native';
if (
Platform.OS === 'android' &&
UIManager.setLayoutAnimationEnabledExperimental
) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
class AnimatedCollapsible extends React.Component {
state = {expanded: false};
render() {
return (
<View style={{overflow: 'hidden'}}>
<TouchableOpacity
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
this.setState({expanded: !this.state.expanded});
}}>
<Text>
Press me to {this.state.expanded ? 'collapse' : 'expand'}!
</Text>
</TouchableOpacity>
{this.state.expanded && <Text>I disappear sometimes!</Text>}
</View>
);
}
}
react native layout animation android
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us