Skip to content

Commit

Permalink
[ADD/#1] Box 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Dec 1, 2023
1 parent fa3406a commit 14827e2
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand All @@ -24,7 +27,7 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
practiceColumn()
practiceBox()
}
}
}
Expand All @@ -48,6 +51,26 @@ class MainActivity : ComponentActivity() {
}
}

@Composable
fun practiceBox() {
Box(
modifier = Modifier
.background(color = Color.Green)
.fillMaxWidth()
.height(200.dp),
) {
Text("오늘 컴포즈")
Box(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
contentAlignment = Alignment.BottomEnd,
) {
Text("완료")
}
}
}

@Preview(showBackground = true)
@Composable
fun defaultPreview() {
Expand Down

0 comments on commit 14827e2

Please sign in to comment.