How to add a button in React Native?

后端 未结 9 674
暖寄归人
暖寄归人 2021-01-31 07:46

I´m confused with this whole \"no CSS\" thing, but I understand why it\'s beneficial. All I want to do is place a button in the middle of the screen but I don\'t understand how

9条回答
  •  孤街浪徒
    2021-01-31 08:37

    You can use built in react-native Button element.

    import React, { Component } from 'react';
    import { StyleSheet, View, Button, Alert, AppRegistry } from 'react-native';
    
    class MainApp extends Component {
    
    _onPress() {
      Alert.alert('on Press!');
     }
    
      render() {
        return (
          
            
              

    Read More Here.

提交回复
热议问题