Skip to content
brainpoint edited this page Feb 28, 2017 · 2 revisions

Example


'use strict';
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, } from 'react-native';
import { Button } from 'react-componet'

class app extends Component {
  render() {
    return (
      <Button onPress={(ev)=>{}}>确定</Button>
    );
  }
}

Gloabl style.

设置全局样式可以改变所有Button的默认样式

Button.style: View.propTypes.style

全局按钮的默认样式

Button.textStyle: Text.propTypes.style

全局按钮的文字部分默认样式

Button.disabledStyle: View.propTypes.style

全局disabled按钮的默认样式

Button.disabledTextStyle: Text.propTypes.style

全局disabled按钮的文字部分默认样式

Props.

disabled: PropTypes.boolean

是否是disabled状态.

onPress: PropTypes.func

点击事件处理函数 (ev)=> {}

textSytle: PropTypes.string

文字样式

Method.

(get/set) text : PropTypes.string/element

获取文字部分. 获取的值为字符串或节点元素