Is there maximum Width Constraint in Compose? 🤔
I'm getting
Can't represent a size of 1168750 in Constraints
Error log when running this code
@Composable
fun Calendar() {
Surface {
Box(
modifier = Modifier
.padding(10.dp)
.size(200.dp)
.horizontalScroll(rememberScrollState())
) {
CalendarBox()
}
}
}
@Composable
fun CalendarBox() {
Box(modifier = Modifier.width(500_000.dp)) {
Text(text = "Event 1", modifier = Modifier.offset(x = 50.dp))
Text(text = "Event 2", modifier = Modifier.offset(x = 499_950.dp))
}
}
@Preview
@Composable
fun CalendarPreview() {
Calendar()
}
Basically, I want to write the widget that is very very wide. (Like calendar).
I had similar code running in
View-based-approach
and it worked well.
Now I want to translate that into compose based solution And I'm stuck with this issue.
If this is framework limitation, is there any suggested approach how can I overcome this? 🤔