No Description

Line.js 661B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * Desc: 1px分割线
  3. *
  4. * Created by WangGanxin on 2018/2/12
  5. * Email: mail@wangganxin.me
  6. */
  7. import React, {Component} from 'react';
  8. import {
  9. StyleSheet,
  10. View,
  11. PixelRatio
  12. } from 'react-native';
  13. import PropTypes from 'prop-types';
  14. let defaultColor = '#bababf';
  15. export default class Line extends Component {
  16. render () {
  17. return (
  18. <View style={[styles.container,{backgroundColor:this.props.lineColor}]} />
  19. );
  20. }
  21. }
  22. Line.defaultProps = {
  23. lineColor: defaultColor,
  24. };
  25. Line.propTypes = {
  26. lineColor:PropTypes.string,
  27. };
  28. const styles = StyleSheet.create({
  29. container: {
  30. width:'100%',
  31. height:1 / PixelRatio.get(),
  32. },
  33. });