Giter Club home page Giter Club logo

Comments (10)

shahen94 avatar shahen94 commented on July 26, 2024 3

@gre Thanks ! setting collapsable={false} helped me

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

it looks like your ref this.refs.screenshot is undefined.

You should make sure you don't call takeSnapshot when your view is not yet rendered or has been unmounted.

from react-native-view-shot.

rohitgoyal avatar rohitgoyal commented on July 26, 2024

@gre Sorry that was my fault actually. I corrected the refs.
My issue is I am getting this error on Android while it is working on iOS.
'Trying to resolve view with tag 232 which doesn't exist.'

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

You probably fall into one of the caveats of the Android implementation. See https://github.com/gre/react-native-view-shot/blob/master/README.md#caveats

Can you try to set collapsable={false} on the view you snapshot?
Android react-native implementation tends to "collapse" the nested view so most View don't always have a native View.

from react-native-view-shot.

gerardus1995 avatar gerardus1995 commented on July 26, 2024

Hi i have the same problem and cant manage to resolve it. This is my code:

        <View style={{position:'absolute', right:45}}>
          <TouchableOpacity  onPress={()=>{
            let shareOptions = null;
            takeSnapshot(this.screenshot, {
              format: "jpeg",
              quality: 0.8,
              result: "base64"
            })
            .then(
              uri => {
                console.log(uri);
                shareOptions = {
                  title: "Nautal",
                  message: "Hola mundo",
                  url: uri,
                  subject: "Share Link" //  for email
                };
              },
              error => console.error("Oops, snapshot failed", error)
            );
            console.log(shareOptions);
            //Share.open(shareOptions);
          }}>
            <View style={[STYLES.circleSecondary, {borderColor:'white', margin:10}]}>
              <Icon name="share-alt" size={15} color="white" />
            </View>
          </TouchableOpacity>
        </View>

And i declare the view that i want snapshot of later in code like this:

      <View ref={(shot) => { this.screenshot = shot; }} style={[STYLES.subContainer,{paddingTop:5}]}>

When i execute the screenshot code page is already rendered but im getting the error anyway. Any ideas how to solve this?

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

@gerardus1995 as said above, set collapsable={false} on the View you snapshot

from react-native-view-shot.

rahulmishra1991 avatar rahulmishra1991 commented on July 26, 2024

@gerardus1995 can you please share your code i have lot of issues.

from react-native-view-shot.

rahulmishra1991 avatar rahulmishra1991 commented on July 26, 2024

How do we this in the flat list? I am trying renderRowItem > View dynamic reference but it's showing undefined...Please let me know if any solution...Thanks!

from react-native-view-shot.

rahulmishra1991 avatar rahulmishra1991 commented on July 26, 2024

This is my flat list code

renderRowItem = (itemData, sectionID, index) => {

Moment.locale('en');
return (
  <View collapsable={false} ref={(shot) => { this.screenshot.itemData.item._id = shot; }} >

 </View>

)
}

How to capture this particular view?

And if i am capturing flat list all items it's showing blur image that won't work for me.

from react-native-view-shot.

michaelVictoriaDev avatar michaelVictoriaDev commented on July 26, 2024

collapsable={false} doent help :/

from react-native-view-shot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.