Android render not correctly
See original GitHub issueBug
I’m trying to create view like this https://i.imgur.com/q2NMUOQ.jpg . Please check the comment section. It has gradient opacity at top. So, I’m doing it like this :
<View style={{ backgroundColor: '#abcdef' }}
<MaskedView
maskElement={(
<LinearGradient colors={['rgba(0,0,0,0)', 'rgba(0,0,0,1)']} style={{
flex: 1,
}} start={{ x: 0, y: 0 }} end={{ x: 0, y: 1 }} locations={[0,0.5]} />
)}
>
<View style={{ width: 100, height: 40, elevation: 5, backgroundColor: 'red' }} />
<View style={{ width: 100, height: 40, elevation: 5, backgroundColor: 'red' }} />
..........
<View style={{ width: 100, height: 40, elevation: 5, backgroundColor: 'red' }} />
</MaskedView>
</View>
It works fine on ios but wrong on android. Please check screenshot https://i.imgur.com/zZpPSzs.png
On android, it black at bottom. How to remove it ? Thank you
Environment info
React native info output:
info
React Native Environment Info:
System:
OS: macOS 10.14.5
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 46.73 MB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.2 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 23, 24, 26, 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.1
System Images: android-27 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5692245
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-cli: 2.0.1
Library version: “@react-native-community/masked-view”: “^0.1.1”
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Android Studio XML Widgets not rendering properly in designer
In android studio top right corner above layout display there is Toggle issue panel click on that and u will see one box...
Read more >Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
Read more >Android render not correctly · Issue #17 · react-native-masked ...
We've found a workaround for android, by setting the opacity of the element via a timeout of 50ms. this.state.gradientColor = '#ffffff' < ...
Read more >Android Studio Rendering Problems | Tek Eye
This article discusses solutions to the Rendering Problems message sometimes seen in Android Studio. Sometimes, usually after a Studio ...
Read more >RecyclerView does not render correctly. [36997736]
Android Studio 1.0 with SDK Tools 24, platform tools 21, build tools 21.1.1, and support library 21.0.2 still can't render recyclerview on Windows...
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
We’ve found a workaround for android, by setting the opacity of the element via a timeout of 50ms.
and a setTimeout which does the following:
amazingly enough this works, but I’d be grateful if this weren’t needed.
It works fine. key is the key to refreshing.