'Column disappears LazyColumn gets scrollable [duplicate]

I want to make a Column beneath a LazyColumn if there is a specific condition fulfilled. This Column appears as expected when my LazyColumn has just a few items available. But when the LazyColumn gets enough items to be scrollable, the Column disappears. It also isn't at the bottom of the List, its gone (or behind the LazyColumn? What wouldn't make any sense).

Did I miss a point somewhere?

Column(
        modifier = Modifier.fillMaxSize(),
        verticalArrangement = Arrangement.SpaceBetween
    ) {
        val tasks =
            viewModel.filteredTasks.value
        Log.d(TAG, "Assigned Tasks: ${tasks.size}")
        Log.d(TAG, "Active Task: ${viewModel.activeTask.value}")
        if (tasks.isNullOrEmpty()) {
            Column(
                modifier = Modifier.fillMaxSize(),
                verticalArrangement = Arrangement.Center,
                horizontalAlignment = Alignment.CenterHorizontally
            ) {
                Text("Keine Aufträge vorhanden")
            }
        } else {
            LazyColumn {
                items(tasks.size) { index ->
                    Column {
                        ListItem(
                            modifier = Modifier
                                .padding(bottom = 8.dp)
                                .clickable {
                                    viewModel.taskDetailId =
                                        tasks[index].montageTaskId
                                    findNavController().navigate(R.id.action_task_list_to_details)
                                },
                            text = {
                                Text(text = "Auftragsnummer: ${tasks[index].montageTaskId}")
                            },
                            secondaryText = {
                                Column {
                                    Text(
                                        text = stringResource(
                                            R.string.owner_string,
                                            tasks[index].locationOwner?.companyName
                                                ?: "Empty..."
                                        )
                                    )
                                    Text(
                                        text = stringResource(
                                            R.string.adress_string,
                                            tasks[index].location.street,
                                            tasks[index].location.number
                                        ),
                                    )
                                }
                            },
                            trailing = {
                                Icon(
                                    imageVector = Icons.Default.KeyboardArrowRight,
                                    contentDescription = "Pfeil nach rechts"
                                )
                            }
                        )
                        Divider()
                    }
                }
            }
        }
        if (viewModel.hasActiveTask.value) {
            Column(
                modifier = Modifier
                    .background(MaterialTheme.colors.primary)
                    .fillMaxWidth()
                    .padding(8.dp)
                    .clickable { navigateToActivity(viewModel.taskDetailId) }
            ) {
                Divider(
                    thickness = 1.dp
                )
                Text(text = "Aktiver Auftrag")
                Text(text = "Something Something")
            }
        }
    }


Solution 1:[1]

I followed this answer and by adding weight(1f) modifier to your LazyColumn I solved the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Primož Ivan?i?