framework/ReactNative

πŸ“˜ [7편] λ””μžμΈ μ‹œμŠ€ν…œ 정리 – κΉ”λ”ν•œ UI둜 μ•± 완성도 높이기

octo54 2025. 6. 10. 13:41
λ°˜μ‘ν˜•

πŸ“˜ [7편] λ””μžμΈ μ‹œμŠ€ν…œ 정리 – κΉ”λ”ν•œ UI둜 μ•± 완성도 높이기


이제 κΈ°λŠ₯은 거의 μ™„μ„±λμŠ΅λ‹ˆλ‹€.
이번 νŽΈμ—μ„œλŠ” μ•±μ˜ 전체적인 λ””μžμΈμ„ μ •λˆν•˜κ³ ,
μ‚¬μš©μžμ—κ²Œ 신뒰감을 μ£ΌλŠ” κΉ”λ”ν•œ UIλ₯Ό κ΅¬μ„±ν•©λ‹ˆλ‹€.


🎯 이번 λͺ©ν‘œ

βœ… 닀크λͺ¨λ“œ λŒ€μ‘
βœ… λ””μžμΈ μ»΄ν¬λ„ŒνŠΈ 뢄리
βœ… 곡톡 μŠ€νƒ€μΌ 적용 (색상, 폰트, 간격)
βœ… κΈ°λ³Έ μ•± μ•„μ΄μ½˜ / μŠ€ν”Œλž˜μ‹œ μ„€μ • (Expo μ‚¬μš©μž ν•œμ •)


🎨 1. λ””μžμΈ 토큰 및 μŠ€νƒ€μΌ 톡일

πŸ“„ src/constants/theme.js

export const colors = {
  primary: '#007aff',
  background: '#f9f9f9',
  text: '#222',
  card: '#fff',
  border: '#ccc',
  completed: '#d3ffd3',
  darkBackground: '#000',
  darkText: '#fff',
};

export const spacing = {
  s: 8,
  m: 16,
  l: 24,
};

export const fonts = {
  regular: 16,
  large: 20,
  header: 24,
};

πŸ’… 2. μ»΄ν¬λ„ŒνŠΈ μŠ€νƒ€μΌ 톡일

예: πŸ“„ components/ChatMessage.js

import { colors, spacing, fonts } from '../constants/theme';

const styles = StyleSheet.create({
  container: {
    padding: spacing.s,
    marginVertical: spacing.s / 2,
    borderRadius: 10,
  },
  user: {
    alignSelf: 'flex-end',
    backgroundColor: colors.primary,
  },
  bot: {
    alignSelf: 'flex-start',
    backgroundColor: colors.card,
  },
  text: {
    fontSize: fonts.regular,
    color: colors.darkText,
  },
});

πŸŒ™ 3. 닀크λͺ¨λ“œ λŒ€μ‘

λ°˜μ‘ν˜•

React Native κΈ°λ³Έ 제곡 useColorScheme() μ‚¬μš©:

import { useColorScheme } from 'react-native';

const scheme = useColorScheme();
const isDark = scheme === 'dark';

const bgColor = isDark ? colors.darkBackground : colors.background;

적용 예:

<View style={{ flex: 1, backgroundColor: bgColor }}>
  {/* μ½˜ν…μΈ  */}
</View>

πŸ–Ό 4. μ•± μ•„μ΄μ½˜ & μŠ€ν”Œλž˜μ‹œ (Expo μ‚¬μš© μ‹œ)

1) app.json μ„€μ •

{
  "expo": {
    "name": "AI Todo",
    "slug": "ai-todo",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    ...
  }
}

2) 이미지 μΆ”κ°€

assets/
β”œβ”€β”€ icon.png
└── splash.png

βœ… 이번 κΈ€ μš”μ•½

λ””μžμΈ μš”μ†Œ 적용 μ—¬λΆ€

곡톡 μŠ€νƒ€μΌ 파일 βœ…
닀크λͺ¨λ“œ λŒ€μ‘ βœ…
μ»΄ν¬λ„ŒνŠΈλ³„ 정리 βœ…
μ•± μ•„μ΄μ½˜ μ„€μ • βœ… (Expo)

πŸ“˜ λ‹€μŒ κΈ€ 예고

λ§ˆμ§€λ§‰ κΈ€μ—μ„œλŠ” 앱을 Android/iOS에 λ°°ν¬ν•˜κ±°λ‚˜
APK 파일둜 내보내고, 포트폴리였 λ˜λŠ” λΈ”λ‘œκ·Έμ—
μ‹€μ œ ν”„λ‘œμ νŠΈλ‘œ μ •λ¦¬ν•˜λŠ” 방법을 μ•ˆλ‚΄ν•©λ‹ˆλ‹€.


 

react native 닀크λͺ¨λ“œ 적용,react native λ””μžμΈ μ‹œμŠ€ν…œ,react native 곡톡 μŠ€νƒ€μΌ,expo splash μ„€μ •,expo μ•± μ•„μ΄μ½˜ μ„€μ •,react native λ””μžμΈ κ°€μ΄λ“œ,react native darkmode μ μš©λ²•,react native ui 예제,react native chat μŠ€νƒ€μΌλ§,react native todo λ””μžμΈ