0.3.0 • Published 11 months ago

@sn-koarashi/react-native-watermark-component v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Watermark(水印)

react-native项目中的水印插件(文字水印)

npm install react-native-watermark-component

使用

使用起来也不麻烦,把WatermarkView当做普通View组件使用就行

import { WatermarkView } from 'react-native-watermark-component';

const {
  watermark = '朋友 · 爱',
  style = styles.container,
  itemWidth = 100,
  itemHeight = 100,
  rotateZ = -45,
  watermarkTextStyle = styles.watermarkTextStyle
} = this.state;

<WatermarkView
    foreground
    watermark={watermark}
    style={style}
    itemWidth={itemWidth}
    itemHeight={itemHeight}
    rotateZ={rotateZ}
    watermarkTextStyle={ watermarkTextStyle }
  >
    <View>
        <Text>朋友 · 爱</Text>
    </View>
    {your_component}
    {/* 这里放置你自己的组件 */}
  </WatermarkView>
propstypedefault valuenotes
foregroundboolfalse是否需要前置水印
styleViewPropTypes.style-
watermarkstring-水印文本内容,为空字符串时不显示水印
itemWidthnumber160单个水印的宽度
itemHeightnumber100单个水印的高度
watermarkTextStyleText.propTypes.style-水印文本样式
rotateZnumber-45水印旋转角度

后置水印 前置水印 结构分析

0.3.0

11 months ago

0.2.0

1 year ago

0.1.0

1 year ago