0.0.4 • Published 9 years ago

react-native-table-row v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

react-native-table-row

a table row for react-native >0.25

installation

npm install react-native-table-row --save

###Basic Usage import TableRow from 'react-native-table-row'

class Example extends Component {
render() {
    const image=<Image source={require('./avatar.jpg')} style={{width:60,height:60,borderRadius:30}}></Image>
    return (
        <View style={styles.container}>
            <TableRow title={'title1'}
                      type={'Summary'}
                      onPress={()=>{}}
                      titleIconStyle={{width:32,height:32}}
                      titleIconSource={require('./avatar.jpg')}
                      subtitle={'a message unRead'}
                      showArrow={true}></TableRow>
            <TableRow title={'title1'} onPress={()=>{}}></TableRow>
            <TableRow title={'title2'} showArrow={true}></TableRow>
            <TableRow title={'title3'} subtitle={'subtitle3'}></TableRow>
            <TableRow title={'title4'} subtitle={'subtitle4'} showArrow={true}></TableRow>
            <TableRow title={'title5'} subElement={image} showArrow={true}></TableRow>
            <TableRow titleElement={image} subtitle={'subtitle'}
                      subtitleStyle={{flex:1,textAlign:'right'}}></TableRow>
        </View>
    );
}}

const styles = StyleSheet.create({
container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
}
});

###Properties

PropTypeRequireDescription
typestringfalsetype must be Basic or Summary,default is Basic
titleIconSourcesourcefalsethe source for image,it must be require('...'),it will use in type of Summary
titleIconStylestylefalsestyle for titleIcon,use in type of Summary
cellBodyStylestylefalseIn addition to the titleIcon of style
onPressfunctionfalsethen function for you when you click
titlestringfalsetext for title
titleStylestylefalsereact native style for title text
titleElementelementfalsethe element of react native,when you use this prop,the prop title and titleStyle will useless
subtitlestringfalsetext for subtitle
subtitleStylestylefalsereact native style for subtitle text
subElementelementflasethe element of react native,when you use this prop,the prop subtitle and subtitleStyle will useless
showArrowbooleanfalseshow arrow in the right
rightIconSourcesourcefalsethe source for image,it must be require("...")

##show case

MacDown Screenshot