Skip to content

Instantly share code, notes, and snippets.

@savelichalex
Last active June 24, 2021 18:19
Show Gist options
  • Save savelichalex/f88b7486fda91edf205c16680ac04751 to your computer and use it in GitHub Desktop.
Save savelichalex/f88b7486fda91edf205c16680ac04751 to your computer and use it in GitHub Desktop.
function ButtonToBottom() {
return (
<ScrollView
style={[
{ flex: 1 },
styles.verticallyInverted,
]}
>
<View style={styles.verticallyInverted}>
<Button title="Press me" />
</View>
{new Array(9)
.fill(null)
.map((_el, i) => (i + 1) / 10)
.map((opacity) => (
<View
key={opacity}
style={[{
height: 100,
backgroundColor: `rgba(255,0,0,${opacity})`,
}, styles.verticallyInverted]}
/>
))}
</ScrollView>
);
}
const styles = StyleSheet.create({
verticallyInverted: {
transform: [{ scaleY: -1 }],
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment