android 不能用提供的参数调用下列函数,是否编写文本?

wtzytmuj  于 2023-02-20  发布在  Android
关注(0)|答案(1)|浏览(153)

下面的文字给我的组成错误,我不知道我做错了什么

Text(
                text = stringResource(R.string.meaning_word),
                modifier = Modifier
                    .padding(6.dp)
                    .align(alignment = Alignment.Start)
                    .fillMaxHeight(0.3f),
                colors = AppColors.mOffWhite,
                fontSize = 17.sp,
                fontWeight = FontWeight.Bold,
                lineHeight = 22.sp
            )

我得到以下错误没有以下函数可以调用提供的参数。

Text(AnnotatedString, Modifier = ..., Color = ..., TextUnit = ..., FontStyle? = ..., FontWeight? = ..., FontFamily? = ..., TextUnit = ..., TextDecoration? = ..., TextAlign? = ..., TextUnit = ..., TextOverflow = ..., Boolean = ..., Int = ..., Map<String, InlineTextContent> = ..., (TextLayoutResult) → Unit = ..., TextStyle = ...) defined in androidx.compose.material
Text(String, Modifier = ..., Color = ..., TextUnit = ..., FontStyle? = ..., FontWeight? = ..., FontFamily? = ..., TextUnit = ..., TextDecoration? = ..., TextAlign? = ..., TextUnit = ..., TextOverflow = ..., Boolean = ..., Int = ..., (TextLayoutResult) → Unit = ..., TextStyle = ...) defined in androidx.compose.material

我尝试了以下答案One of the following functions can be called with the arguments supplied没有帮助

8cdiaqws

8cdiaqws1#

这是因为没有带colors参数的文本函数。它的颜色也需要更改对齐。开始是对齐。水平到其中之一

相关问题