커뮤니티
포인트
로딩중
쿠폰
내 강의실
국비 신청 내역
수강권
증명서
숙제 피드백
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
메인사진과 버튼 간격 조정
[왕초보] 나만의 수익성 앱, 앱개발 종합반
2주차
북마크
신*혁
댓글
9
추천
0
조회수
12
조회수
12
답변 완료

import { StatusBar } from 'expo-status-bar';

import React from 'react';

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

const main = 'https://storage.googleapis.com/sparta-image.appspot.com/lecture/main.png'



export default function App() {

  return (

    <ScrollView style={styles.container}>

      <View style={styles.textContainer}>

        <Text style={styles.textStyle}>나만의 꿀팁</Text>

        <Image style={styles.mainImage} source={{uri:main}}/>

       

        <ScrollView style={styles.mybutton} horizontal={true}>

        <TouchableOpacity style={styles.button01}><Text style={styles.middleButtonText}>생활</Text></TouchableOpacity>

        <TouchableOpacity style={styles.button02}><Text style={styles.middleButtonText}>재테크</Text></TouchableOpacity>

        <TouchableOpacity style={styles.button03}><Text style={styles.middleButtonText}>반려견</Text></TouchableOpacity>

        <TouchableOpacity style={styles.button04}><Text style={styles.middleButtonText}>꿀팁 찜</Text></TouchableOpacity>

         

       


        </ScrollView>

       

     


      </View>

      <StatusBar style="light" />

     


    </ScrollView>

  );

}


const styles = StyleSheet.create({

  container: {

    flex: 1,

    backgroundColor: '#fff',

   

   

  },

 

 

  textStyle: {

    fontSize : 20,

    fontWeight : "700",

    marginTop : 50,

    marginLeft: 20,

 

  },

  mainImage: {

   

    width:'90%',

   

    height:200,

   

    borderRadius:10,

    marginTop:20,

    alignSelf:"center"

  },

 

  mybutton: {

   

    margintop:20,

    marginLeft:10,

    height:60,

   

   

   


  },

  button01: {

    width:100,

    height:50,

    padding:15,

    backgroundColor:"#ffd700",

    borderColor:"#fff",

    borderRadius:15,

    margin:7,

  },

  button02: {

    width:100,

    height:50,

    padding:15,

    backgroundColor:"#FFA07A",

    borderColor:"#fff",

    borderRadius:15,

    margin:7

  },

  button03: {

    width:100,

    height:50,

    padding:15,

    backgroundColor:"#B0E0E6",

    borderColor:"#fff",

    borderRadius:15,

    margin:7

  },

  button04: {

    width:100,

    height:50,

    padding:15,

    backgroundColor:"#FF69B4",

    borderColor:"#fff",

    borderRadius:15,

    margin:7

  },

  middleButtonText: {

    color:"#fff",

    alignSelf:"center",//text 가운데정렬

    fontWeight: "bold"


  }

  }

 

   

   

   

   


   

 


)



magintop을 건드려도 간격이 안떨어지네요. 버튼들을 더 밑으로 내리고 싶은데

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