Hi i have a vertical scrollable compose column as ...
# compose
t
Hi i have a vertical scrollable compose column as follows:-
Column(
modifier = Modifier
._fillMaxSize_()
._verticalScroll_(rememberScrollState())
) *{...}*
and i would like to add
PullRefreshIndicator(isRefreshing, pullRefreshState, Modifier._align_(Alignment.TopCenter))
Ive tried this, however it doesnt work 😞,
Copy code
Column(
    modifier = Modifier
        .fillMaxSize()
        .verticalScroll(rememberScrollState())
) {
    Box(
        modifier = Modifier
            .pullRefresh(pullRefreshState)
            .fillMaxSize()
    ) {
        Row(
            modifier = Modifier
                .padding(start = 8.dp, end = 8.dp)

        ) {
            Column(
                modifier = Modifier
                    .weight(1f)
            ) {
                uiState.items.entries.forEach { categoryMap ->

                    if (categoryMap.key == null)
                        doNothing()
                    else {
                        val parentRssCategory: RssFeedsCategoryUI = uiState.items[null]?.first { it.categoryId == categoryMap.value.first().parentCategory }!!

                        Divider(thickness = 1.dp, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.1f))

                        RssCategoryFilterChip(viewModel, parentRssCategory)

                        Spacer(modifier = Modifier.height(4.dp))

                        FlowRow(modifier = Modifier.fillMaxWidth()) {
                            categoryMap.value.forEach { category -> RssCategoryFilterChip(viewModel, category) }
                        }

                        Spacer(modifier = Modifier.height(16.dp))
                    }
                }
            }
        }
        PullRefreshIndicator(isRefreshing, pullRefreshState, Modifier.align(Alignment.TopCenter))
    }
}
s
You’re putting the PullRefresh inside a column, under the Box content, so if anything it’d show under that, that’s surely not what you want right? Take a look at this and then further down this as an example of how to make it work inside a Box where one of the children is the PullRefreshIndicator, and another one further up is the content, which is also scrollable