Android: Can't adjust Animated.View's opacity from 1 to 0
See original GitHub issuethis has been issued since last year and tagged resolved, but it seems still occurs the same trouble.
const opacity = useMemo(()=> new Animated.Vaue(1),[something]);
useEffect(() => {
Animated.timing( opacity, {
toValue(0),
duration: 500,
useNativeDriver: true,
}
},[something]);
...
return (
...
<Animated.View style={{opacity: opacity}}>
<div> ... </div>
</Animated.View>
...
)
this is the first issue that I found
https://github.com/facebook/react-native/issues/25318
and my react-native info
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 1.56 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 26, 28, 29, 30
Build Tools: 29.0.2, 30.0.1
System Images: android-28 | Google Play Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_262 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
android - Show and hide a View with a slide up/down animation
Show activity on this post. Easiest solution: set android:animateLayoutChanges="true" on the container holding your views. To put it into some context: If you ......
Read more >Reveal or hide a view using animation - Android Developers
For the view that is fading in, animate its alpha value from 0 to 1 . For the view that is fading out,...
Read more >Animation resources - Android Developers
An animation resource can define one of two types of animations: Property Animation: Creates an animation by modifying an object's property ...
Read more >Animation | Jetpack Compose - Android Developers
You can customize the animation specifications by providing an AnimationSpec . See AnimationSpec for more information. AnimatedContent (experimental). Caution: ...
Read more >WindowManager.LayoutParams - Android Developers
Adjustment option for softInputMode : set to have a window not adjust for a ... Fully transparent windows: This window has LayoutParams#alpha equal...
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
I can confirm that it only works when you set the opacity to something like to 0.99. Thanks @jiyoon127 for the suggestion. I would never arrive to this workaround myself.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community’s attention? This issue may be closed if no further activity occurs. You may also label this issue as a “Discussion” or add it to the “Backlog” and I will leave it open. Thank you for your contributions.