-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.android-BUTTON.js
47 lines (44 loc) · 1.46 KB
/
index.android-BUTTON.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React, { Component } from 'react';
import { AppRegistry, View ,Button,StyleSheet,Alert } from 'react-native';
export default class ButtonBasics extends Component {
_onPressButton() {
Alert.alert('You tapped the button!')
}
render() {
return (
// <Button onPress={() => {Alert.alert('You tapped the button!')}} title="Press Me"/>
<View style={styles.container}>
<View style={this.buttonContainer}>
<Button onPress={this._onPressButton}
title="Press Me"/>
</View>
<View style={styles.buttonContainer}>
<Button onPress={this._onPressButton}
title="Press Me"
color="#841584"/>
</View>
<View style={styles.alternativeLayoutButtonContainer}>
<Button onPress={this._onPressButton}
title="This looks great!"/>
<Button onPress={this._onPressButton}
title="OK!" color="#841584"/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center'
},
buttonContainer: {
margin:20
},
alternativeLayoutButtonContainer: {
margin: 20,
flexDirection: 'row',
justifyContent: 'space-between'
}
})
AppRegistry.registerComponent('AwesomeProject',()=>ButtonBasics);