
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } from 'react';
import { ScrollView, StyleSheet, Text, View, TouchableOpacity, SafeAreaView, Button, Alert, Touchable, Image } from 'react-native';
import favicon from "./assets/favicon.png"
export default function App() {
const customAlert = () => {
Alert.alert("팝업창이 뜹니다")
}
const customAlert1 = () => {
Alert.alert("폭발직전")
}
return (
<SafeAreaView style={styles.container}>
<ScrollView style={styles.containerZero}>
<View style={styles.containerOne}>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
</View>
<View style={styles.containerTwo}>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.textContainer} onPress={customAlert}>
<Text style={styles.textStyle}>영역을 충분히 갖는 텍스트 입니다!</Text>
</TouchableOpacity>
</View>
<View style={styles.containerThree}>
<TouchableOpacity style={styles.imageContainer} onPress={customAlert1}>
<Image
source={favicon}
resizeMode={"repeat"}
style={styles.imageStyle}
/>
</TouchableOpacity>
</View>
</ScrollView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
containerZero: {
flex: 1,
backgroundColor: '#fff',
},
containerOne: {
flex: 1,
backgroundColor: 'red',
},
containerTwo: {
flex: 1,
backgroundColor: 'blue',
},
containerThree: {
flex: 1,
backgroundColor: 'blue',
},
textContainer: {
flex:1,
justifyContent: 'center',
backgroundColor:'green',
height:100,
borderColor:'green',
borderWidth:5,
borderRadius:10,
margin:10,
},
textStyle: {
textAlign:"center",
},
imageContainer:{
height:100,
borderColor:'green',
borderWidth:1,
borderRadius:10,
margin:10,
padding:15
},
imageStyle: {
flex: 1,
width: 370,
height: 100
}
});
expo는 연결되어 있는데 그냥 백지상태로 뜹니다.. 코드스니펫 다른거 입력하면 뜨는데 어디를 수정해야 할까요,,
