skip to Main Content

Hi I want to get underline for only 2 letters but getting for full text how to get underline only for first 2 letters, Below is the code i have used to get underline for text.

<Text
                style={{
                  textDecorationLine: "underline",
                  textDecorationColor: "#F88022",
                  textDecorationStyle: "solid",
                  marginTop: SCREENHEIGHT * 0.08,
                  fontFamily: "Outfit-Regular",
                  fontSize: SCREENHEIGHT * 0.023,
                  color: "#0C0C0C",
                }}
              >
                Contract Details
              </Text>

2

Answers


  1. use Text component inside Text component

    <Text>
    your rest of the text
        <Text
            style={{
             textDecorationLine: "underline",
             textDecorationColor: "#F88022",
             textDecorationStyle: "solid",
             marginTop: SCREENHEIGHT * 0.08,
             fontFamily: "Outfit-Regular",
             fontSize: SCREENHEIGHT * 0.023,
             color: "#0C0C0C",
           }}>
              your underline text
          </Text>
    
    </Text>
    
    Login or Signup to reply.
  2. Use this code:

    <View style={{flexDirection: 'row'}}>
      <Text>The Other Text </Text>
        <Text
          style={{
            textDecorationLine: "underline",
            textDecorationColor: "#F88022",
            textDecorationStyle: "solid",
            marginTop: SCREENHEIGHT * 0.08,
            fontFamily: "Outfit-Regular",
            fontSize: SCREENHEIGHT * 0.023,
            color: "#0C0C0C",
          }}
        >
          Contract Details
        </Text>
      <Text>The Other Text </Text>
    </View>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search