Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How i can remove react-native button shadow?

I am trying to figure out React Native. When I created button I see unexpected bottom shadow. How can i prevented? (Gray color)

enter image description here

Code:

<Button 
    title="LOGIN"
    color='#f2a743'
/>
like image 257
John Avatar asked Jul 01 '17 15:07

John


2 Answers

I successfully removed the shadow with elevation: 0 in the button's style.

like image 72
batmanbury Avatar answered Sep 28 '22 08:09

batmanbury


I don't think thats possible. If you don't need a button elevation (shadow), you may create your own react-native button using using Touchables(TochableOpacity, TochableHighlight, TouchableWithoutFeedback). And it's not a big deal.

Please refer to the docs.

renderButton = () => { 
  return ( 
    <TouchableOpacity onPress={this._onPressButton}> 
      <ImageBackground style={styles.button} source={require('./myButton.png')} >
      <Text>Press me</Text>
      </ImageBackground>
    </TouchableOpacity>
  );
}
like image 23
Ansal Ali Avatar answered Sep 28 '22 07:09

Ansal Ali