title: How to implement horizontal scroller in android jetpack compose ui?
body: <p>I'm trying to achieve a horizontal scroll view using jetpack compose like below:</p>
  <p><img src="https://i.stack.imgur.com/UJUmr.png?s=256" alt="Pic Of what I want" /></p>
  <p>But I couldn't find any solution to set the width of cell to take width of screen with 16dp margin, and that's what I'm getting:</p>
  <p><img src="https://i.stack.imgur.com/wIB1z.png?s=256" alt="Pic Of what I'm getting" /></p>
  <p>This the my code:</p>
  <pre><code>private val imageList : Array&lt;Effect&lt;Image&gt;&gt; =arrayOf(
          imageResource(R.drawable.maldive),
          imageResource(R.drawable.maldiveone),
          imageResource(R.drawable.maldivetwo))
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContent {
              createList()
          }
  
  
      }
  
      @Composable
      fun createList(){
          MaterialTheme() {
              HorizontalScroller(){
                  Row(crossAxisSize = LayoutSize.Expand) {
                      (0..3).forEachIndexed { _, i -&gt;
                              populateListItem(i)
                      }
                  }
              }
          }
      }
      @Composable
      fun populateListItem(index: Int){
                  Column(crossAxisSize = LayoutSize.Wrap, modifier = Spacing(16.dp)) {
                      Card(elevation = 0.dp, shape = RoundedCornerShape(8.dp, 8.dp, 8.dp, 8.dp)) {
                          val im: Image = +imageList[index.rem(3)]
                          Container(expanded = true,height = 180.dp)
                           {
                              DrawImage(image = im)
                          }
                      }
                      HeightSpacer(height = 16.dp)
                      Text(&quot;Maldive $index&quot;,
                          style = +themeTextStyle { h6 })
                      Text(&quot;Enjoy Our $index Resort!&quot;,
                          style = +themeTextStyle { body2 })
          }
      }
  </code></pre>