123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import React from 'react';
- import {
- Alert,
- Button,
- StyleSheet,
- View,
- } from 'react-native';
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- },
- buttonContainer: {
- margin: 20,
- },
- alternativeLayoutButtonContainer: {
- margin: 20,
- flexDirection: 'row',
- justifyContent: 'space-between',
- },
- });
- class ButtonBasics extends React.Component {
- onPressButton() {
- Alert.alert('You pressed THE button');
- }
- render() {
- return (
- <View style={styles.container}>
- <View style={styles.buttonContainer}>
- <Button onPress={this.onPressButton}
- title="Press me"
- />
- <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>
- );
- }
- }
- export default ButtonBasics;
|