커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
코드스니펫을 복사 붙여넣기 했는데도 강의화면속 결과와 제 결과가 다릅니다.
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
2주차
북마크
방*희
댓글
3
추천
0
조회수
12
조회수
12
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


https://spartacodingclub.kr/community/fastqna/all/63afc2318a137c2efce26976/%EA%B0%95%EC%9D%98%ED%99%94%EB%A9%B4%EC%B0%A8%EC%9D%B4?origin=shared

이분 상황과 똑같습니다.

이때 튜터님들 답변으로는 style에 buttonStyle 이 없다고 해주셨는데 제가 보기에는

강의속 화면에 코드와 똑같이 작성한것 같은데, 어디에 버튼스타일이라는 단어가 들어가야하는건가요?





import React from 'react';
import { StyleSheet, Text, View, Button, Alert } from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';


export default function App() {
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.textContainer}>
        <Text style={styles.textStyle}>아래 버튼을 눌러주세요</Text>
        {/* 버튼 onPress 속성에 일반 함수를 연결 할 수 있습니다. */}
        <Button 
          style={styles.buttonStyle} 
          title="버튼입니다 "
          color="#f194ff" 
          onPress={function(){
            Alert.alert('팝업 알람입니다!!')
          }}
        />
        {/* ES6 문법으로 배웠던 화살표 함수로 연결 할 수도 있습니다. */}
        <Button 
            style={styles.buttonStyle} 
            title="버튼입니다 "
            color="#FF0000" 
            onPress={()=>{
              Alert.alert('팝업 알람입니다!!')
            }}
          />
          </View>
    </SafeAreaView>
  );
}


const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
  },
  textContainer: {
    height:100,
    margin:10,
  },
  textStyle: {
    textAlign:"center"
  },
});



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴