-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] [Android] Elevated style property does not behave correctly on TouchableOpacity #15889
Comments
if I remember correctly, the elevation needs to be set as a prop on the view itself, not the styles |
Just checked, an |
Noticing this as well, |
@Annorstades my issue was #10411 Had to add a |
It seems to me Android clips shadow because it can't draw outside of a component boundaries. Try to make two views TouchableOpacity inside View, apply elevation to TouchableOpacity and add padding for wrapper View. Maybe I'm wrong. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
Is this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes, I have,
Environment
react-native -v
: 0.48.2node -v
: 8.1.4npm -v
: 5.0.3yarn --version
: 1.0.1Then, specify:
Android 7.1.1
Steps to Reproduce
TouchableOpacity
in your rootView
elevation: 10,
style propExpected Behavior
On other components, a level 10 shadow would create a fairly noticeable shadow.
Actual Behavior
When a level 10 elevation is applied to a
TouchableOpacity
, the shadow is so faint it's almost indiscernible from the background. If you try to increase the elevation, the behaviour is even stranger. Once the elevation exceeds 30, the barely distinguishable shadow we had before disappears completely. In a word, I'd say the shadows are about 10x less pronounced than on other components. For no apparent reason.elevation: 10
elevation: 50
Reproducible Demo
One the move currently; will post an Expo Snack when I get home.
The text was updated successfully, but these errors were encountered: