【发布时间】:2022-09-27 14:11:13
【问题描述】:
所以我试图按照这个文档来实现类似于documentation 的东西,这就是 CardTitle 移动和图像的位置;但是本文档中的 Title 和 Description 现在似乎在卡片上不可用?当我尝试创建卡片时,我无法访问它。最大的问题卡不再有描述,也许这需要更新或者我该如何实现这一点。我正在尝试类似于显示的图像的东西。
文档中的代码。
@Composable
fun Card(
imageUrl: String,
title: String,
description: String
) {
var showMore by remember { mutableStateOf(false) }
BoxWithConstraints {
if (maxWidth < 400.dp) {
Column {
Image(imageUrl)
Title(title)
}
} else {
Row {
Column {
Title(title)
Description(
description = description,
showMore = showMore,
onShowMoreToggled = { newValue ->
showMore = newValue
}
)
}
Image(imageUrl)
}
}
}
}
标签: android-jetpack-compose jetpack