(React Native)更改视图的顺序 - 将视图置于前面

时间:2018-01-02 04:53:43

标签: android ios reactjs mobile native

我正在使用react-native-sketch库https://www.npmjs.com/package/react-native-sketch,我遇到了一些问题。我想投影一个灰色的文本并在其上面“写”,就像这样。

enter image description here

我遇到的问题是我目前的设置,我可以在草图视图上书写,但文字在草图视图“上方”,所以我看不到文本视图背后的任何文字。如何在sketchview上方移动文本?谢谢!

import Sketch from 'react-native-sketch';
import React, {Component} from 'react';
import { ScrollView,StyleSheet, Text, View, TouchableHighlight } from 'react-native';

export default class App extends React.Component {
  save = () => { this.sketch.save().then(({ path }) => { Alert.alert('Image saved!', path); }); };

  render() {
  return (
  <View> 
      <CardView>
        <View>
        <Text> Draw </Text>
        <View> 
        <Sketch
          ref={sketch => { this.sketch = sketch; }}
          strokeColor="black"
          style = {styles.sketch}
          strokeThickness={3}> 
          <View> 
          <Text> text here </Text>
          </View>
        </Sketch> 
      </View>
        </View>
      </CardView>
      </View>

      );
    }
  }
 

0 个答案:

没有答案