Skip to content

Instantly share code, notes, and snippets.

@syamjayaraj
Created July 24, 2018 19:49
Show Gist options
  • Save syamjayaraj/8d53900d1b46d4a32e99ceee606ced9f to your computer and use it in GitHub Desktop.
Save syamjayaraj/8d53900d1b46d4a32e99ceee606ced9f to your computer and use it in GitHub Desktop.
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