๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

2023 ์•ˆ๋“œ๋กœ์ด๋“œ23

Android ์•ฑ์— ์ด๋ฏธ์ง€ ์ถ”๊ฐ€ 6~ 6. ์ด๋ฏธ์ง€ ์ปดํฌ์ €๋ธ”์˜ ์œ„์น˜ ์ง€์ • ๋ฐ ํฌ๊ธฐ ์กฐ์ • ์ด๋ฏธ์ง€๋ฅผ ์ „์ฒด ํ™”๋ฉด ํฌ๊ธฐ๋กœ ์กฐ์ •ํ•˜์—ฌ ์•ฑ์„ ๊พธ๋ฉฐ๋ณด์ž! ์ด๋ฅผ ์œ„ํ•ด Modifier ๋ฐ ContentScale ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ์ˆ˜์ •์ž ์ˆ˜์ •์ž๋Š” Jetpack Compose UI์š”์†Œ๋ฅผ ์žฅ์‹ํ•˜๊ฑฐ๋‚˜ ์ด ์š”์†Œ์— ๋™์ž‘์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ํ–‰์ด๋‚˜ ํ…์ŠคํŠธ, ๋ฒ„ํŠผ์— ๋ฐฐ๊ฒฝ์ด๋‚˜ ํŒจ๋”ฉ, ๋™์ž‘์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋ฅผ ์„ค์žฅํ•˜๋ ค๋ฉด ์ปดํฌ์ €๋ธ”์ด ์ˆ˜์ •์ž๋ฅผ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ํ—ˆ์šฉํ•ด์•ผ ํ•œ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด Text ์ปดํฌ์ €๋ธ”์—๋Š” ๋ฐฐ๊ฒฝ ์ƒ‰์ƒ์„ ๋…น์ƒ‰์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” Modifier ์ธ์ˆ˜๊ฐ€ ์•˜๋‹ค. Text( text = "Hello, World!", // Solid element background color modifier = Modifier.background(color = Color.Gr.. 2022. 11. 16.
Android ์•ฑ์— ์ด๋ฏธ์ง€ ์ถ”๊ฐ€ ~5 Image composable ์‚ฌ์šฉํ•˜์—ฌ ์•ฑ์— ์ด๋ฏธ์ง€ ์ถ”๊ฐ€ํ•˜๊ธฐ https://github.com/google-developer-training/basic-android-kotlin-compose-birthday-card-app/blob/main/app/src/main/res/drawable-nodpi/androidparty.png GitHub - google-developer-training/basic-android-kotlin-compose-birthday-card-app Contribute to google-developer-training/basic-android-kotlin-compose-birthday-card-app development by creating an account on GitHub.. 2022. 11. 16.
๊ธฐ๋ณธ ๋ ˆ์ด์•„์›ƒ ๋งŒ๋“ค๊ธฐ 3. ํ…์ŠคํŠธ ์ปดํฌ์ €๋ธ”๋กœ ๊ฐ„๋‹จํ•œ ์•ฑ ๋นŒ๋“œ 1. ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— Jetpack Compose๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ™”๋ฉด์— ์ƒ์ผ ์ถ•ํ•˜ ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•˜๋Š” ๊ฐ„๋‹จํ•œ android ์•ฑ์„ ๋นŒ๋“œํ•ฉ๋‹ˆ๋‹ค. 3. Happy Birthday ์•ฑ ์„ค์ • Empth Compose Activity ํ…œํ”Œ๋ฆฟ์œผ๋กœ Happy Birthday ์•ฑ์„ ๋งŒ๋“ค๋ฉด Android ์ŠคํŠœ๋””์˜ค์—์„œ๋Š” ํ™”๋ฉด์— ํ‘œ์‹œ๋˜๋Š” Hello Android! ๋ฉ”์‹œ์ง€๋ฅผ ๋น„๋กฏํ•˜์—ฌ ๊ธฐ๋ณธ Android ์•ฑ์˜ ๋ฆฌ์†Œ์Šค๋ฅผ ์„ค์ •ํ•œ๋‹ค. ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค(UI)๋ž€? ์•ฑ์—์„œ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ž€ ํ™”๋ฉด์— ํ‘œ์‹œ๋˜๋Š” ํ…์ŠคํŠธ, ์ด๋ฏธ์ง€, ๋ฒ„ํŠผ, ๊ธฐํƒ€ ์—ฌ๋Ÿฌ ์œ ํ˜•์˜ ์š”์†Œ ๋ฐ ํ™”๋ฉด์— ํ‘œ์‹œ๋˜๋Š” ๋ฐฉ์‹ ์ฆ‰, ์•ฑ์ด ์ฝ˜ํ…์ธ ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ํ‘œ์‹œํ•˜๋Š” ๋ฐฉ์‹์ด์ž ์‚ฌ์šฉ์ž๊ฐ€ ์•ฑ๊ณผ ์ƒํ˜ธ์ž‘์šฉํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค. ์ด๋Ÿฌํ•œ ๊ฐ๊ฐ์˜ ์š”์†Œ๋ฅผ UI ๊ตฌ์„ฑ์š”์†Œ๋ผ๊ณ  ํ•œ.. 2022. 11. 16.
์ฒซ Android ์•ฑ ๋งŒ๋“ค๊ธฐ 6. ๋ฐฐ๊ฒฝ ์ƒ‰์ƒ ๋ณ€๊ฒฝ import ์‹œ ์•ŒํŒŒ๋ฒณ ์ˆœ์œผ๋กœ ํ•˜๋Š” ๊ฒŒ ์ข‹๋‹ค. help - find action - Optimize Imports ํด๋ฆญ @Composable fun Greeting(name: String) { Surface(color = Color.Magenta) { Text(text = "Hello my name is $name!") } } 7. ํŒจ๋”ฉ ์ถ”๊ฐ€ ํ…์ŠคํŠธ ์ฃผ์œ„์— ๊ณต๋ฐฑ(ํŒจ๋”ฉ)์„ ์ถ”๊ฐ€ํ•ด๋ณด์ž @Composable fun Greeting(name: String) { Surface(color = Color.Magenta) { Text(text = "Hi, my name is $name!", modifier = Modifier.padding(24.dp)) } } Modifier๋Š” ์ปดํฌ์ €๋ธ”์„ ๊ฐ•ํ™”ํ•˜๊ฑฐ.. 2022. 11. 15.
728x90