UNPKG

rn-project

Version:

#### 项目介绍 类似一个脚手架的工具 此项目致力于构建一套基础,简单,可维护的 适配我司的react-native项目。可在此基础上搭建项目,封装了基础架构,基础组件,以及各种交互等;可快速进行项目搭建,开发。 # 涉及主要技术 - 1. 项目主要架构 * react native * react-navigation * redux

70 lines (64 loc) 1.59 kB
import React, { Component } from 'react'; import { StyleSheet, View, Text } from 'react-native'; import { SafeAreaView } from 'react-navigation'; import BaseStyle from '../constants/Style'; import Btn from '../components/buttons'; import Dims from '../utils/View'; export default class ButtonScreen extends Component { constructor(props) { super(props); } render() { return ( <SafeAreaView style={[BaseStyle.flex, styles.homebg]} forceInset={{ top: 'never' }}> <View style={styles.container}> <Text style={styles.text}> 支持个性化样式</Text> <Btn text={'确定'} onPress={() => {}} /> <Btn disabledBtnStyle={styles.disBtn} disabled={true} text={'确定'} onPress={() => {}} /> <Btn text={'我是个长按钮'} btnStyle={styles.btnStyle} underlayColor={'red'} onPress={() => {}} /> <Btn disabled={true} text={'我是个长按钮'} disabledBtnStyle={styles.btnStyle} onPress={() => {}} /> </View> </SafeAreaView> ); } } const styles = StyleSheet.create({ homebg: { backgroundColor: '#eee', }, container: { ...BaseStyle.flex, paddingTop: 20, }, text: { paddingLeft: 15, marginBottom: 20, }, disBtn: { marginTop: 40, }, btnStyle: { marginTop: 20, marginLeft: 0, marginRight: 0, borderRadius: 0, width: Dims.size.width, }, });