바르고 뜨겁게
ReactNative - CSS 두가지 방법 본문
StyleSheet 사용
import React from "react";
import { ActivityIndicator, View, StyleSheet } from "react-native";
import { TINT_COLOR, BG_COLOR } from "../constants/Colors";
const styled = StyleSheet.create.create({
container: {
backgroundColor: "black",
flex: 1,
justifyContent:"space-around"
}
});
export default () => (
<View style={styled.container}>
<ActivityIndicator color={TINT_COLOR} />
</View>
);
styled-components 사용
import React from "react";
import { ActivityIndicator } from "react-native";
import { TINT_COLOR, BG_COLOR } from "../constants/Colors";
import styled from "styled-components";
const Container = styled.View`
flex: 1;
background-color: ${BG_COLOR};
justify-content: center;
`;
export default () => (
<Container>
<ActivityIndicator color={TINT_COLOR} />
</Container>
);
'자바스크립트 > React Native' 카테고리의 다른 글
ReactNative - Shadow 스타일 (Platform ios , android) (0) | 2019.08.20 |
---|---|
ReactNative - 슬라이드 배너 (0) | 2019.06.21 |
ReactNative - 화면이동 버튼 TouchableOpacity (1) | 2019.06.18 |
ReactNative - Tab Navigation (0) | 2019.06.18 |
ReactNative - Assets PreLoad 세팅 (0) | 2019.06.18 |
Comments