0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

10. ホーム画面 - スクロール

最小構成 

@Composable
fun HomeScreen(modifier: Modifier = Modifier) {
    // Implement composable here
    Column() {
        SearchBar()
        HomeSection(title = R.string.align_your_body) {
            AlignYourBodyRow()
        }
        HomeSection(title = R.string.favorite_collections) {
            FavoriteCollectionsGrid()
        }
    }
}

image.png

SearchBarの微調整

  • 上と水平方向にそれぞれ16.dpのpaddingをつける
    • Spacer(modifier = modifier.height(16.dp))
      • 上部のパディングがSpacerの役割であることがわかりにくなるので、Spacerを使用する
    • SearchBar(modifier = Modifier.padding(horizontal = 16.dp))
      • 水平方向のpadding

image.png

  • 隙間ができる

Columnの微調整

  • LazyColumnでない場合にスクロール動作を追加するときは 、modifier.verticalScrollを使用する
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?