커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
앱을 이동시켰는데요;;
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v5
5주차
북마크
김*정
댓글
7
추천
0
조회수
8
조회수
8
답변 완료

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

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


오전에 질문드린 부분 해결을 못해서

해로 만들기를 하고 이동을 시키고 설치를 대충 다해서

거의 만들었는데요..

그러고 났더니 오류가 하나뜹니다.



스파르타 즉문즉답




작성한 코드 및 에러 메세지


import React,{useState,useEffect} from 'react';

import { StyleSheet, Text, View, Image, ScrollView,TouchableOpacity, Alert, Share, Platform } from 'react-native';

import * as Linking from 'expo-linking';

import {firebase_db} from "../firebaseConfig"

import * as Application from 'expo-application';

const isIOS = Platform.OS === 'ios';


export default function DetailPage({navigation,route}) {


    const [tip, setTip] = useState({

        "idx":9,

        "category":"성장",

        "title":"성장과 발전",

        "image": "https://firebasestorage.googleapis.com/v0/b/spart-name-khj-dfc19.appspot.com/o/Special%2Fsundfdocdo01.jpg?alt=media&token=19577f39-e1d4-42f8-bf39-044b8d7906dc",

        "desc":"미국의 유명한 작가이자 유머리스트인 마크 트웨인의 잘 알려지지 않은 명언을 소개합니다. 친절은 귀머거리도 들을 수 있고 장님도 볼 수 있는 언어입니다. 이 인용구는 신체적 한계를 뛰어넘는 보편적인 언어로서 친절의 중요성을 강조합니다. 이 말은 듣거나 볼 수 없더라도 간단한 친절의 행동이 주변 사람들에게 깊은 영향을 미칠 수 있다는 것을 상기시켜 줍니다.",        

    })

   

    useEffect(()=>{

        console.log(route)    

        navigation.setOptions({    

          title:"성장하는 나를 위해",  

          headerStyle: {

                backgroundColor: "#5252cc",

                shadowColor: "black",

            },

            headerTintColor: "white"

        })

        //넘어온 데이터는 route.params에 들어 있습니다.

        const { idx } = route.params;

        firebase_db.ref('/tip/'+idx).once('value').then((snapshot) => {

            let tip = snapshot.val();

            setTip(tip)

        });

    },[])


    const like = async () => {

       

        // like 방 안에

        // 특정 사용자 방안에

        // 특정 찜 데이터 아이디 방안에

        // 특정 찜 데이터 몽땅 저장!

        // 찜 데이터 방 > 사용자 방 > 어떤 찜인지 아이디

        let userUniqueId;

        if(isIOS){

        let iosId = await Application.getIosIdForVendorAsync();

            userUniqueId = iosId

        }else{

            userUniqueId = await Application.androidId

        }


        firebase_db.ref('/like/'+userUniqueId+'/'+ tip.idx).set(tip,function(error){

            console.log(error)

            Alert.alert("저장 완료!")

         });

    }


    const share = () => {

        Share.share({

            message:`${tip.title} \n\n ${tip.desc} \n\n ${tip.image}`,

        });

    }


    const link = () => {

        Linking.openURL("https://gongu.copyright.or.kr/gongu/main/main.do")

    }


    return (

        // ScrollView에서의 flex 숫자는 의미가 없습니다. 정확히 보여지는 화면을 몇등분 하지 않고

        // 화면에 넣은 컨텐츠를 모두 보여주려 스크롤 기능이 존재하기 때문입니다.

        // 여기선 내부의 컨텐츠들 영역을 결정짓기 위해서 height 값과 margin,padding 값을 적절히 잘 이용해야 합니다.

        <ScrollView style={styles.container}>

            <Image style={styles.image} source={{uri:tip.image}}/>

            <View style={styles.textContainer}>

                <Text style={styles.title}>{tip.title}</Text>

                <Text style={styles.desc}>{tip.desc}</Text>

                <View style={styles.buttonGroup}>

                    <TouchableOpacity style={styles.button} onPress={()=>like()}><Text style={styles.buttonText}>   저장하기</Text></TouchableOpacity>

                    <TouchableOpacity style={styles.button} onPress={()=>share()}><Text style={styles.buttonText}>   공유하기</Text></TouchableOpacity>

                    <TouchableOpacity style={styles.button} onPress={()=>link()}><Text style={styles.buttonText}> 이미지출처</Text></TouchableOpacity>

                </View>                

            </View>            

        </ScrollView>

   

    )

}


const styles = StyleSheet.create({

    container:{

        backgroundColor:"lightblue"

    },

    image:{

        height:270,

        margin:20,

        marginTop:70,

        borderRadius:25

    },

    textContainer:{

        padding:40,

        justifyContent:"center",

        alignItems:"center"

    },

    title: {

        fontSize:27,

        fontWeight:'700',

        marginTop:3,

        color:"black"

    },

    desc:{

        marginTop:20,

        color:"black"

    },

    buttonGroup: {

        flexDirection:"row"

    },

    button:{

        width:100,

        marginTop:40,

        marginRight:10,

        marginLeft:10,

        padding:10,

        borderWidth:2,

        borderColor:"deeppink",

        borderRadius:10

    },

    buttonText:{        

        color:'#0000b3',

        TextAlign:"center"

    }

})


오류뜨는 곳의 메세지랑 같은 코드가 위치한 곳이라..


Warning: Failed %s type: %s%s, prop, Invalid props.style key `TextAlign` supplied to `Text`.

Bad object: {

 "color": "#0000b3",

 "TextAlign": "center"

}

Valid keys: [

 "alignContent",

 "alignItems",

 "alignSelf",

 "aspectRatio",

 "borderBottomWidth",

 "borderEndWidth",

 "borderLeftWidth",

 "borderRightWidth",

 "borderStartWidth",

 "borderTopWidth",

 "borderWidth",

 "bottom",

 "columnGap",

 "direction",

 "display",

 "end",

 "flex",

 "flexBasis",

 "flexDirection",

 "flexGrow",

 "flexShrink",

 "flexWrap",

 "gap",

 "height",

 "justifyContent",

 "left",

 "margin",

 "marginBlock",

 "marginBlockEnd",

 "marginBlockStart",

 "marginBottom",

 "marginEnd",

 "marginHorizontal",

 "marginInline",

 "marginInlineEnd",

 "marginInlineStart",

 "marginLeft",

 "marginRight",

 "marginStart",

 "marginTop",

 "marginVertical",

 "maxHeight",

 "maxWidth",

 "minHeight",

 "minWidth",

 "overflow",

 "padding",

 "paddingBlock",

 "paddingBlockEnd",

 "paddingBlockStart",

 "paddingBottom",

 "paddingEnd",

 "paddingHorizontal",

 "paddingInline",

 "paddingInlineEnd",

 "paddingInlineStart",

 "paddingLeft",

 "paddingRight",

 "paddingStart",

 "paddingTop",

 "paddingVertical",

 "position",

 "right",

 "rowGap",

 "start",

 "top",

 "width",

 "zIndex",

 "shadowColor",

 "shadowOffset",

 "shadowOpacity",

 "shadowRadius",

 "transform",

 "backfaceVisibility",

 "backgroundColor",

 "borderBottomColor",

 "borderBottomEndRadius",

 "borderBottomLeftRadius",

 "borderBottomRightRadius",

 "borderBottomStartRadius",

 "borderColor",

 "borderCurve",

 "borderEndColor",

 "borderLeftColor",

 "borderRadius",

 "borderRightColor",

 "borderStartColor",

 "borderStyle",

 "borderTopColor",

 "borderTopEndRadius",

 "borderTopLeftRadius",

 "borderTopRightRadius",

 "borderTopStartRadius",

 "elevation",

 "opacity",

 "pointerEvents",

 "color",

 "fontFamily",

 "fontSize",

 "fontStyle",

 "fontVariant",

 "fontWeight",

 "includeFontPadding",

 "letterSpacing",

 "lineHeight",

 "textAlign",

 "textAlignVertical",

 "textDecorationColor",

 "textDecorationLine",

 "textDecorationStyle",

 "textShadowColor",

 "textShadowOffset",

 "textShadowRadius",

 "textTransform",

 "userSelect",

 "verticalAlign",

 "writingDirection"

], 

  at Text (http://192.168.35.155:19000/index.bundle?platform=android&dev=true&hot=false&strict=false&minify=false:61582:27)

  in DetailPage (created by SceneView)

  in StaticContainer

  in EnsureSingleNavigator (created by SceneView)

  in SceneView (created by CardContainer)

  in RCTView (created by View)

  in View (created by CardContainer)

  in RCTView (created by View)

  in View (created by CardContainer)

  in RCTView (created by View)

  in View

  in CardSheet (created by Card)

  in RCTView (created by View)

  in View (created by AnimatedComponent)

  in AnimatedComponent

  in AnimatedComponentWrapper (created by PanGestureHandler)

  in PanGestureHandler (created by PanGestureHandler)

  in PanGestureHandler (created by Card)

  in RCTView (created by View)

  in View (created by AnimatedComponent)

  in AnimatedComponent

  in AnimatedComponentWrapper (created by Card)

  in RCTView (created by View)

  in View (created by Card)

  in Card (created by CardContainer)

  in CardContainer (created by CardStack)

  in RNSScreen (created by AnimatedComponent)

  in AnimatedComponent

  in AnimatedComponentWrapper (created by InnerScreen)

  in Suspender (created by Freeze)

  in Suspense (created by Freeze)

  in Freeze (created by DelayedFreeze)

  in DelayedFreeze (created by InnerScreen)

  in InnerScreen (created by Screen)

  in Screen (created by MaybeScreen)

  in MaybeScreen (created by CardStack)

  in RNSScreenContainer (created by ScreenContainer)

  in ScreenContainer (created by MaybeScreenContainer)

  in MaybeScreenContainer (created by CardStack)

 "params": Object {

  "idx": 0,

 },

 "path": undefined,

}


뜨는 오류 메세지입니다.


아.. 어렵네요;;

감사합니다.




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