- 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>
);
'공부기록' 카테고리의 다른 글
공부기록, 2021-07-27(react) (0) | 2021.07.27 |
---|---|
공부기록, 2021-07-26(react) (0) | 2021.07.26 |
공부기록, 2021-07-22(expo) (0) | 2021.07.22 |
공부기록, 2021-07-21(jsp) (0) | 2021.07.21 |
공부기록, 2021-07-14(jsp) (0) | 2021.07.20 |