Skip to content

Instantly share code, notes, and snippets.

@syamjayaraj
Created Jul 24, 2018
Embed
What would you like to do?
export default class FAB extends Component {
...
...
render() {
const { data } = this.state;
return (
<View style={styles.container}>
...
...
<TouchableOpacity onPress={() => alert('FAB clicked')} style={styles.fab}>
<Text style={styles.fabIcon}>+</Text>
</TouchableOpacity>
</View>
)
}
}
const styles = StyleSheet.create({
...
...
fab: {
position: 'absolute',
width: 56,
height: 56,
alignItems: 'center',
justifyContent: 'center',
right: 20,
bottom: 20,
backgroundColor: '#03A9F4',
borderRadius: 30,
elevation: 8
},
fabIcon: {
fontSize: 40,
color: 'white'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment