ibitcy / react-native-hole-view

✂️ React-Native component to cut a touch-through holes anywhere you want. Perfect solution for tutorial overlay
395 stars 23 forks source link

dynamic hole #24

Closed fukemy closed 1 year ago

fukemy commented 1 year ago

Hi, I want to create facebook message gradient effect like this: 7d07db2e-8c43-4af8-86e4-d6369b7decc5

THen I found hold-view can do it (I think so) As the Image above, the massageContainer is white background then the holdview is the TextMessage, that hard to calculate position. So I want to ask do you provide hold item as a child like this? Thanks so much

fukemy commented 1 year ago

I tried to using like this::

<RNHoleView>
<RNHole>
   <TextMessage/>
</RNHole>
</RNHoleView>

But it not working

stephenkopylov commented 1 year ago

If I understand it right - you need to highlight some message in your chat's scrollview

The only way to do it is to calculate the absolute bounding box of your message's view and apply this bounding box as a hole to RNHoleView

This library doesn't provide this kind of functionality out of the box so you should write it by yourself

fukemy commented 1 year ago

hell thanks you