Created
February 24, 2018 09:45
-
-
Save longsangstan/03c3f0e833ed2eb75c349f64dc002700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MaskedViewIOS, View } from "react-native"; | |
import LinearGradient from "react-native-linear-gradient"; | |
// ... | |
const MaskedView = Platform.OS == "ios" ? MaskedViewIOS : View; | |
render = () => { | |
return ( | |
<MaskedView | |
style={styles.outputView} | |
maskElement={ | |
<LinearGradient | |
locations={[0, 0.1, 0.9, 1]} | |
colors={[ | |
"transparent", | |
"black", | |
"black", | |
"transparent" | |
]} | |
style={styles.outputView} | |
/> | |
} | |
> | |
<ScrollView | |
style={styles.outputView} | |
/> | |
</MaskedView> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment