React Native Horizontal ScrollView

 App Name: Test

Component Name: App.js

-------------------------------------------------------------------------------------------------------------------

/* eslint-disable prettier/prettier */
import React, { Component } from 'react';
import {
StyleSheet,
Button,
ScrollView,
Text,
View,
} from 'react-native';
class App extends Component {
onPressButton() {
alert('You Clicked ReactNative King button ')
}
render() {
return (
<ScrollView horizontal={true} style={StyleSheet.container}>
<Text style={{fontSize:25, padding: 20}}>Horizontal ScrollView</Text>
<View style={[{width:230,height: 80, padding: 20}]}>
<Button
onPress={this.onPressButton}
title="Click Me"
color="red"
/>
</View>
</ScrollView>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
})
export default App;

Comments

Popular posts from this blog

React Native FlatList

React Native class component