I am trying to use IntrinsicSize.Max to make Rows the same length but it is not working for my code. I tried weight(1f) also but did dot worked either.
The rows are ignoring the weight and IntrinsicSize code but instead are being wrap to content width. The following is the relevant code:
Column(
modifier = Modifier
.fillMaxWidth(),
verticalArrangement = Arrangement.Center
) {
LazyColumn(
state = lazyState
) {
itemsIndexed(currentItems) { index, item ->
Row(verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Start,
modifier = Modifier
.width(IntrinsicSize.Max)
) {
Text(text = "${(index + 1)}. ", modifier.width(nwidth), textAlign = TextAlign.End)
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.horizontalScroll(scrollState)
.width(IntrinsicSize.Max)
) {
content(index, item)
}
}
}
}
}
The content(index, item) is:
content = { index, data ->
Text(text = SimpleDateFormat("yyyy-MMM-dd HH:mm:ss").format(data.logdate),
modifier
.width(dwidth)
)
Text(text = data.logerror.removePrefix("00^"),
modifier
.fillMaxWidth()
.onGloballyPositioned {
val temp = with(density) { it.size.width.toDp() }
ewidth = if (temp > ewidth) temp else ewidth
},
color = if (data.logerror.startsWith("00^")) Color.Black else Color.Red
)
}