Viewshot 오류 해결

여기서 갤러리에 저장 버튼을 작동하는데,

여기서 저 돋보기 버튼을 누르면,

[Unhandled promise rejection: Error: The content size must not be zero or negative. Got: (0, 0)]

라는 에러콘솔이 입력되고 갤러리에 파일이 저장이 되지 않는다.

-> 수정완료!
-> Viewshot 밑에 view로 한번 더 묶어줬더니 오류가 해결되었다.

{/* 캔버스보드 부분 */}
      <ViewShot ref={captureRef} options={{ format: "jpg", quality: 0.9 }}>

      <View style={{ marginTop: 10, marginLeft: 900, height: 1000, width: 900, justifyContent: "center", alignItems: "center", }} >
        <Text style={{ fontSize: 25, letterSpacing: 5, position: "absolute", left: "-41%", top: 0, lineHeight: 150, width: "85%"}}> {Liter}  </Text>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 100, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 250, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 400, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 550, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 700, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>
        <View style={{ height: 100, width: "85%", position: "absolute", left: "-42%", top: 850, }}>
          <SignatureScreen ref={ref} onOK={handleOK} webStyle={style} />
        </View>

        {/* 가로줄 */}
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 50, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 100, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 150, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 200, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 250, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 300, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 350, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 400, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 450, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 500, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 550, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 600, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 650, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 700, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 750, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 800, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 850, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 900, }} />
        <View style={{ width: "85%", height: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 950, }} />

        {/* 세로줄 */}
        <View style={{ height: 900, width: 1, backgroundColor: "#000000", position: "absolute", left: "-42%", top: 50, }} />
        <View style={{ height: 900, width: 1, backgroundColor: "#000000", position: "absolute", left: "43%", top: 50, }} />

      
        </View></ViewShot>

-> 위 오류는 추후에 캔버스를 draw 라이브러리를 이용해 구현함으로서 자연스레 쓸모가 없어졌다 ^_^

좋은 웹페이지 즐겨찾기