Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text里面只能是写死的文字 不能添加变量 有人有解决方案吗 #9

Closed
talentjiang opened this issue Jun 29, 2017 · 2 comments

Comments

@talentjiang
Copy link

RT

@xu-duqing
Copy link
Owner

可以是一个变量的,你是怎么实现的?

@xu-duqing
Copy link
Owner

xu-duqing commented Feb 24, 2018

  render(){
    const xxx = '虚线文字1'
    return(
      <View style={styles.container}>
        <Surface width={150} height={50}>
          <Text strokeWidth={1} strokeDash={[2,2,2,2]} stroke="#000" font="bold 35px Heiti SC" path={new Path().moveTo(40,40).lineTo(99,10)} >{xxx}</Text>
        </Surface>
      </View>
    )
  }

试一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants