使用Android Studio长颈鹿2022.3.1 因此,在此版本的Android Studio中使用预设推荐的编译器
在.align()
上查找冲突的在线信息可以在列/行范围内使用.有人说它不起作用,或者只在BoxScope内部起作用.
然而,Android开发人员简介CODELAB使用了以下代码,并推荐在ColumnScope中使用Modifier.align()
,这会引发相同的错误:
100
无法访问"ColumnScope eInstance":它位于"androidx.compose.efitation.layout"中的内部
未解析的引用:结束
import androidx.compose.foundation.layout.ColumnScopeInstance.align // import causing the first error
{ //Column Scope
Text(
text = message,
fontSize = 100.sp,
lineHeight = 116.sp,
textAlign = TextAlign.Center
)
Text(
text = from,
fontSize = 36.sp,
modifier = Modifier
.padding(16.dp)
.offset(90.dp)
.align(Alignment.End), // Error on this line
textAlign = TextAlign.Left
)
}