https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

12/07/2021, 2:31 PM
Accompanist pager question: This card shows nothing on purpose and is a very small size. maybe like 24.dps in height.
Copy code
Card(
    modifier = Modifier.padding(horizontal = 16.dp).fillMaxWidth().align(BottomCenter),
    elevation = 8.dp) { //nothing }
When I add a HorizontalPager (replace where it says //nothing with the HP), then the card height becomes the size of the screen. Why and how do you make it only take up the height of the Text?
Copy code
HorizontalPager(count = 10) { page ->
  // Our page content
  Text(text = "Page: $page", modifier = Modifier.fillMaxWidth())
}
j

Joseph Hawkes-Cates

12/07/2021, 2:54 PM
Have you tried setting the height of the Card to IntrinsicSize.Min?
s

Stylianos Gakis

12/07/2021, 3:02 PM
This ^^ was merged in
v0.21.4-beta
so could you try that and say if it fixes it or not?
c

Colton Idle

12/08/2021, 9:53 AM
That worked! Thanks
👏 1