jayeszee / rn-draw

React native draw tool for react native applications
50 stars 36 forks source link

SurfaceView should have explicit width and height set #11

Closed wisteria-hill-technologies closed 6 years ago

wisteria-hill-technologies commented 6 years ago

Hi,

I am trying to make this work, but I get this error. SurfaceView should have explicit width and height set

Is this bug or am I doing something wrong?

Thank you

wisteria-hill-technologies commented 6 years ago

OK, I figured out that I need to set width and height in containerStyle in the RNDraw component or just wrap the RNDraw component in a View component (which looks better) as below: <View style={{height: 350, width:350}}> <RNDraw containerStyle={{backgroundColor: 'rgba(0,0,0,0.01)'}} rewind={(undo) => {this._undo = undo}} clear={(clear) => {this._clear = clear}} color={'#000000'} strokeWidth={4} /> </View>

jayeszee commented 6 years ago

Great, glad you sorted that out!