Hi , What is the alternative of ScrollBar in compo...
# compose
w
Hi , What is the alternative of ScrollBar in compose. I have already tried Modifier.verticalScroll . Wanted to understand is there a way to acheive scrollview
d
You use
Modifier.scrollable
that acts like a
ScrollView
or `LazyRow`/`LazyColumn` that acts like a
RecyclerView
w
I used Column(Modifier.scrollable ) and no ScrollView is getting visible , Basically I need a scrollbar when the scrolling is happening
d
What about putting the layout in a box like:
Copy code
Box{
  val stateVertical = rememberScrollState(0)
  Something(
    modifier = Modifier
        .fillMaxSize()
        .verticalScroll(stateVertical)
  )
  
  VerticalScrollbar(
    modifier = Modifier.align(Alignment.CenterEnd)
            .fillMaxHeight(),
    adapter = rememberScrollbarAdapter(stateVertical)
  )
}
w
Checked that already , But VerticalScrollBar is not accesible
d
yeah, it is not available without
compose-jb
, you can still draw it yourself like this: https://stackoverflow.com/a/68056586/5827505
w
Tried the same , but the scrollbar is not getting visible. If you already tried and working for you , can you pls share the snippet of the implementation
d
I haven't used it on android, only on desktop, I will try these days and tell you if it worked.
w
Sure thanks