728x90 2023 ์๋๋ก์ด๋23 4.Compose ์ฌ๋ถ๋ฉด ์ด๊ฒ์ ๊ตฌํํด์ผํ๋ค. ์ด๋ ค์ ใ ใ ใ ใ ใ ๊ทผ๋ฐ modifier = Modifier .weight(1f,false).background(Color.Green) .padding(top = 16.dp, end = 16.dp, bottom = 16.dp, start = 16.dp) .fillMaxWidth( ์ฌ๊ธฐ์ weight ์ค๋ฅ๊ฐ ๋ฌ๋ค. import๋ฅผ ํด๋ ์ ๋นจ๊ฐ ์ ์ด ์์์ด์ง์ง........ ์๋ฃจ์ ์ฝ๋ /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in complianc.. 2022. 11. 17. ์ฐ์ต: Compose ๊ธฐ๋ณธ ์ฌํญ 1 ) MainActivity.kt package com.example.learntogether import android.os.Bundle import android.text.style.TextAppearanceSpan import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.Image import androidx.compose.foundation.layout.* import androidx.compose.material.MaterialTheme import androidx.compose.material.Surface import android.. 2022. 11. 17. 10. ์๋ฃจ์ ์ฝ๋ ๊ฐ์ ธ์ค๊ธฐ ~ 11. ๊ฒฐ๋ก GitHub์ ๋ถ๊ธฐ ์ ์ฅ์: ์ปดํจํฐ์ ํด๋ก (๋ณต์ฌ)ํ๋ ์ ์ฒด ํ๋ก์ ํธ(๋๋ ํฐ๋ฆฌ ๋ฐ ํ์ผ)์ ๋๋ค. ๋ธ๋์น๋ ์ ์ฅ์์ ๋ฒ์ , ์ฆ ๋ ๋ฆฝ์ ์ธ ๊ฐ๋ฐ๋ผ์ธ์ด๋ค. ์๋ฅผ ์ผ๋ ์ด ๊ณผ์ ์์ starter ๋ถ๊ธฐ๋ Codelab์ ์งํํ๋๋ฐ ๊ธฐ์ด๋ก ์ฌ์ฉํ ํ๋ก์ ํธ์ ๋ฒ์ ์ด ๋ ์ ์๋ค. ~ ์ดํ ๋ค์ ์ฝ๊ธฐ ๊ฒฐ๋ก Android ์คํ๋์ค์ Resource Mangager ํญ์ ์ฌ์ฉํ๋ฉด ์ด๋ฏธ์ง์ ๊ธฐํ ๋ฆฌ์์ค๋ฅผ ์ถ๊ฐํ๊ณ ๊ตฌ์ฑํ ์ ์๋ค. Image ์ปดํฌ์ ๋ธ์ ์ฑ์ ์ด๋ฏธ์ง๋ฅผ ํ์ํ๋ UI์์์ด๋ค. Image ์ปดํฌ์ ๋ธ์ ์ฝํ ์ธ ์ค๋ช ์ด ์์ด์ผ ์ฑ์ด ์ ๊ทผ์ฑ์ด ๋์์ง๋ค. ์์ผ ์ถํ ๋ฉ์์ง์ ๊ฐ์ ์ฌ์ฉ์์๊ฒ ํ์๋๋ ํ ์คํธ๋ ์ฑ์ ๋ค๋ฅธ ์ธ์ด๋ก ์ฝ๊ฒ ๋ฒ์ญํ ์ ์๋๋ก ๋ฌธ์์ด ๋ฆฌ์์ค๋ก ์ถ์ถํด์ผํ๋ค. 2022. 11. 16. Android ์ฑ์ ์ด๋ฏธ์ง ์ถ๊ฐ [ ๋์ ๊ณผ์ ] stringResource stringResource ๋ getString ์ ๋ ๊ฒ ํ๋ฉด HappyBirthdayTheme { // A surface container using the 'background' color from the theme Surface(color = MaterialTheme.colors.background){ BirthdayGreetingWithImage(stringResource(R.string.happy_birthday_text), from = getString( R.string.signature_text)) } } getString( )์ผ๋ก ๋์ค๋๋ฐ ์์ง? HappyBirthdayTheme { // A surface container using the 'background' .. 2022. 11. 16. ์ด์ 1 2 3 4 5 6 ๋ค์ 728x90