How to get Context in Jetpack Compose

前端 未结 7 1670
情歌与酒
情歌与酒 2021-02-19 07:35
fun createListItem(itemIndex: Int) {
Padding(left = 8.dp, right = 8.dp, top = 8.dp, bottom = 8.dp) {
    FlexRow(crossAxisAlignment = CrossAxisAlignment.Center) {
               


        
7条回答
  •  借酒劲吻你
    2021-02-19 08:00

    You can access to context with define ambientContext.

    Example:

    val context = ContextAmbient.current
    

提交回复
热议问题