5
5
.
.
1
1
.
.
1
1
.
.
b
b
a
a
c
c
k
k
g
g
r
r
o
o
u
u
n
n
d
d
I
I
n
n
f
f
o
o
[
[
R
R
]
]
.background modifier defines View Background.
Syntax
.background(Color.Green)
.background(Color.Green, CutCornerShape(5.dp))
E
E
x
x
a
a
m
m
p
p
l
l
e
e
MainActivity.kt
package com.example.testcompose
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.Text
import androidx.compose.foundation.background
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.setContent
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Text("Hello", Modifier.background(Color.Green) )
}
}
}
Output