Not able to set ShadowColor in Android
See original GitHub issueIs this a bug report?
yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS High Sierra 10.13.1 Node: 8.9.1 Yarn: 0.17.10 npm: 5.6.0 Watchman: 4.7.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0
Steps to Reproduce
- Run this code
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
class App extends Component {
render() {
return (<View style={styles.container}>
<View>
<TouchableOpacity style={[styles.boxShadow, shadow]}>
<Text style={styles.text}>LOGIN</Text>
</TouchableOpacity>
</View>
</View>);
}
}
const shadow = {
shadowColor: '#30C1DD',
shadowRadius: 10,
shadowOpacity: 0.6,
elevation: 8,
shadowOffset: {width: 0,height: 4}
}
const styles = {
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
boxShadow: {
width: 200,
height: 50,
borderRadius: 10,
backgroundColor: '#ed7171',
justifyContent: 'center',
alignItems: 'center'
},
text: {
color: '#ffffff'
}
};
export default App;
Expected Behavior
Is there way to achieve like this Shadow in Android
as shadow Props of react-native only supports in iOS
- color can be changed
- Tried elevation but can not change default greyed color
- able to achieve in ios with shadowColor props but not in android as it is only support iOS
Actual Behavior
See sample code and preview. It should be work for android too. Shadow color is always grey however I tried to change. Please make support for android too.
Reproducible Demo
This is sample snapshot
Issue Analytics
- State:
- Created 6 years ago
- Reactions:15
- Comments:13
Top Results From Across the Web
Not able to set ShadowColor in react-native android
Shadow color is always grey, however I tried to change.. Reproducible Demo. This is sample snapshot in which I can only get shadow...
Read more >Not able to set ShadowColor in react-native android-Reactjs
your now able to add shadow color in react native 0.64. TheEhsanSarshar 1833. score:4. As of now the only ways to add shadow...
Read more >Create Shadows and Clip Views - Android Developers
Assign Elevation to Your Views Figure 1 - Shadows for different view elevations. To set the default (resting) elevation of a view, use...
Read more >How to apply shadows on React Native - Medium
On Android, we need to use the elevation view style prop from react-native to add shadows. ... That's the end of the story,...
Read more >Box Shadow in React Native - Javatpoint
The first type is shadowColor, which determines the color of the box's shadow. Please note that it is the shadow accessory that works...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?
I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.
How to Contribute • What to Expect from Maintainers
@react-native-bot issue is still there 57.0