Ioane Sharvadze
06/25/2021, 8:52 AMCan'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? 🤔gildor
06/25/2021, 9:09 AMgildor
06/25/2021, 9:10 AMIoane Sharvadze
06/25/2021, 9:34 AMgildor
06/25/2021, 9:35 AMIoane Sharvadze
06/25/2021, 9:46 AMIoane Sharvadze
06/25/2021, 10:41 AMoffsets
and sizing properly :Sgildor
06/25/2021, 12:04 PMgildor
06/25/2021, 12:07 PMIoane Sharvadze
06/27/2021, 1:31 PM