
@Composable
fun CompletionSquare(questionType: QuestionType, number: Int) {
Box(
modifier = Modifier
.wrapContentHeight()
.background(color = colorResource(id = R.color.gray))
.padding(1.dp)
) {
Column(
modifier = Modifier
.background(color = colorResource(id = R.color.teal))
.aspectRatio(matchHeightConstraintsFirst = true, ratio = 1.0f)
) {
Text(text = questionType.type)
Spacer(modifier = Modifier.height(16.dp))
Text(text = number.toString())
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/743 ... -on-height
Мобильная версия