Reputation: 103
I am trying to figure out React Native. When I created button I see unexpected bottom shadow. How can i prevented? (Gray color)
Code:
<Button
title="LOGIN"
color='#f2a743'
/>
Upvotes: 10
Views: 14560
Reputation: 75
The following code will remove button shadow
style = {{ elevation: 0 }}
Upvotes: 4
Reputation: 1613
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>
);
}
Upvotes: 6
Reputation: 63
you can't use style="box-shadow: 0px 0px 0p;" at all there is multi way to approach this i personal use elevation: 0
if you use router-flux for navigation pls consider that icons appear with shadow just on android but no shadow exist for ios version by default
Upvotes: 1
Reputation: 349
I successfully removed the shadow with elevation: 0
in the button's style.
Upvotes: 15
Reputation: 602
Whats about using css
to remove the shadow?
style="box-shadow: 0px 0px 0p;"
Upvotes: 1