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?

More than 1 year has passed since last update.

デザインの詳細

  • 画像の高さは 88 dp にする
  • テキストのベースラインと画像の間隔は 24 dp にする
  • ベースラインと要素の底部の間隔は 8 dp にする
  • テキストは bodyMedium のタイポグラフィスタイルにする

最小構成

  • AlignYourBodyElement()
    • modifier
    • Column()
      • modifier
      • Image()
      • Text()
@Composable
fun AlignYourBodyElement(
    modifier: Modifier = Modifier
){
    Column(
        modifier = modifier
    ) {
       Image(
           painter = painterResource(R.drawable.),
           contentDescription = null
       )
       Text(text = stringResource(R.string.))
    }
}

Imageコンポーザブルの調整パラメータ

  • Imageコンポーザブル
    • contentScale
      • ContentScale.Cropで切り抜きの指定
        • modifierでのサイズ指定をもとに切り抜く
        • → contentScaleとmodifierはセットで機能する
    • modifier
      • 画像サイズの指定
        • Modifier.size(88.dp) 
      • 画像形状の指定
        • .clip(CircleShape)
        • 円形を指定

Columnコンポーザブルの調整パラメータ

  • ColumnでラップしているUI要素を水平方向に中央揃えで配置
    • horizontalAlignment = Alignment.CenterHorizontally

Textコンポーザブルの調整パラメータ

  • BaseLineからのpadding調整
    • modifier = Modifier.paddingFromBaseline(top = 24.dp, bottom = 8.dp)
  • 文字のFont設定
    • style = MaterialTheme.typography.bodyMedium
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?