gre / react-native-view-shot

Snapshot a React Native view and save it to an image
https://github.com/gre/react-native-view-shot-example
MIT License
2.66k stars 345 forks source link

[Iphone X] ref capture cause entire screen to scale #261

Open mmamoyco opened 5 years ago

mmamoyco commented 5 years ago

bug report

We using this lib to capture card element on screen. On iphone < iphoneX devices it works just fine, but on Iphone X capture method causes strange behavior. The entire screen scales for just a sec and then all is ok.

Before calling capture mehod() Simulator Screen Shot - iPhone 11 - 2019-10-02 at 13 12 43

After calling capture method() entire screen scales for just a moment Simulator Screen Shot - iPhone 11 - 2019-10-02 at 13 12 48

Tested with ViewShot component and captureRef approaches.

Version & Platform

└── react-native-view-shot@3.0.2  

Platform: IOS

Expected behavior: Screen must not jump, scale

Actual behavior: Screen scale for a sec after calling capture method.

Steps to reproduce the behavior

  1. Create view you want to capture
  2. Capture it using IphoneX.
gre commented 4 years ago

Can you tell us more about how you use captureRef? are you using snapshotContentContainer ? thanks

mmamoyco commented 4 years ago

Hi, thx for reply

I tried captureRef approach like this captureRef(this._frontSide.current, { format: 'jpg', quality: 0.8, }); _frontSide reference created with React.createRef() and attached to View component as ref property.

About snapshotContentContainer. No, im not using it