1

I need to locate some of the string's location from the TextView so that I can move my imageView's location to that certain location inside Textview to show my gif images using glide in recyclerView.

This is what I've than so far: enter image description here

I replaced the previous string with space to transfer my imageview on that certain position but before I will replace it with space I need to locate the string's position on the screen from the position of the string inside textview.

MJ_
  • 63
  • 1
  • 1
  • 10
  • can you provide a screen shot of your desirable? – nikhil bansal Jan 07 '19 at 11:04
  • is the cursor/focus active i.e you can get location of cursor in the textView but location of some text in text View is not possible with TextView APi's – Anmol Jan 07 '19 at 11:05
  • 2
    Possible duplicate of [get position of the text inside a TextView](https://stackoverflow.com/questions/52428868/get-position-of-the-text-inside-a-textview) – nikhil bansal Jan 07 '19 at 11:06
  • I think this is not a duplicate. OP seems wants to know the absolute position of a TextView, while this "possible duplicate" asks to get real width / height. – Geno Chen Jan 07 '19 at 12:09
  • @nikhilbansal I have added the screenshot, that's what I'm trying to achieve. – MJ_ Jan 08 '19 at 02:36
  • @Anmol What I did was on the first load of the items from the adapter, each item will be parse by getting the string on that certain textview. Can I now what certain TextView API's that are not capable of detecting the location? – MJ_ Jan 08 '19 at 03:07
  • so you want to place the image where u put the space now? Please clear the use case to get a better solution. – nikhil bansal Jan 08 '19 at 07:10
  • @nikhilbansal sorry for getting you confused. What I'm trying to achieve is to only get the string position, I'll handle the space parsing. So let's just think that I did not remove those string and replace with space. How can I get that certain string position from that textview? After that, I will set my Imageview's position on that certain position. – MJ_ Jan 08 '19 at 07:45

0 Answers0