skip to Main Content

I want to convert the part of a string (textview) that contains the username to clickable and after the user clicks, move it to the same user’s profile page (like messengers like Telegram)
For example :
My username in Telegram is @Khapez

I’m going to make Khapez clickable

Thank you all

2

Answers


  1. you have to use Position: "absolute", with suitable value for bottom,top,left,right
    to keep the username View next to @ in different View

    <View style={{width: "80%", height: 100}}>
    <View style={{width: 50, height: 50}}>
    <Text>@</Text>
    <View>
    <TouchableOpacity style={{position: "absolute", top: 0, left: 50}}>
    <Text>@</Text>
    <TouchableOpacity>
    <View>
    

    tweak the top and left value as per position, only after padding, margin etc done and set to View that contains @

    Login or Signup to reply.
  2. This is a good library for it. The result of that library is below:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search