Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 设置下划线长度_Javascript_React Native - Fatal编程技术网

Javascript 设置下划线长度

Javascript 设置下划线长度,javascript,react-native,Javascript,React Native,我想设置下划线的长度,你知道我该怎么做吗 这个下划线的长度取决于单词的长度,我会设置这个维度 View style={consumer.body}> <View style={consumer.bodyInputs}> <TextInput style={consumer.inputs} placeholder="Codice Fiscale"

我想设置下划线的长度,你知道我该怎么做吗

这个下划线的长度取决于单词的长度,我会设置这个维度

View style={consumer.body}>
          <View style={consumer.bodyInputs}>
            <TextInput
              style={consumer.inputs}
              placeholder="Codice Fiscale"
              keyboardType="default"
              underlineColorAndroid="grey"
              onChangeText={value => {
                //code... 
              }
              }
            />
          </View>

一个简单的方法是使用空的
。见下例:

   <View style={styles.body}>
      <View style={styles.bodyInputs}>
        <TextInput
          style={styles.inputs}
          placeholder="Codice Fiscale"
          keyboardType="default"
          underlineColorAndroid="grey"
        />
        // here we create your bottom border 
        <View style={{width: 80, height: 1, backgroundColor: '#000'}}/>
      </View>
    </View>

//在这里,我们创建您的底部边框
输出:

工作零食:


一个简单的方法是使用空的
。见下例:

   <View style={styles.body}>
      <View style={styles.bodyInputs}>
        <TextInput
          style={styles.inputs}
          placeholder="Codice Fiscale"
          keyboardType="default"
          underlineColorAndroid="grey"
        />
        // here we create your bottom border 
        <View style={{width: 80, height: 1, backgroundColor: '#000'}}/>
      </View>
    </View>

//在这里,我们创建您的底部边框
输出:

工作零食: