简体   繁体   English

我怎么能在 Jetpack Compose 中制作这样的视图?

[英]How could i make this view like this in jetpack compose?

enter image description here在此处输入图像描述

i still confused using component view in jetpack compose, please help me for making this one.我仍然对在 Jetpack Compose 中使用组件视图感到困惑,请帮助我制作这个。 thanks谢谢

i was tried but it's not like current view in figma我试过了,但它不像 figma 中的当前视图

Card(modifier = Modifier
    .fillMaxWidth()
    .padding(horizontal = 20.dp)
    .wrapContentHeight(), elevation = 8.dp,
    shape = RoundedCornerShape(25.dp)
) {
    Row(
        modifier = Modifier
            .fillMaxWidth()
            .padding(horizontal = 4.dp)
            .wrapContentHeight(),
        verticalAlignment = Alignment.CenterVertically,
        horizontalArrangement = Arrangement.SpaceBetween
    ) {

        Image(painter = painterResource(id = R.drawable.ic_points_star_icon), modifier = Modifier
            .padding(vertical = 8.dp)
            .size(60.dp), contentDescription = "")

        Column(modifier = Modifier
            .weight(1f)
            .padding(vertical = 8.dp), horizontalAlignment = Alignment.Start) {
            Text(text = "Heading Text", style = AppTheme.typography.boldHeaderStyle)
            Text(text = "This is sample body text", color = textColor.copy(0.4f), style = AppTheme.typography.captionTextStyle)
        }
        Button(
            onClick = { /*Your on Click*/ },
            shape = RoundedCornerShape(5.dp),
            elevation = ButtonDefaults.elevation(
                defaultElevation = 0.dp,
                pressedElevation = 0.dp,
                disabledElevation = 0.dp,
                hoveredElevation = 0.dp,
                focusedElevation = 0.dp,
            ),
            colors = ButtonDefaults.buttonColors(
                backgroundColor = BackArrowTint.copy(0.6f),
                contentColor = Color.White
            ),
            modifier = Modifier
                .wrapContentHeight()
                .padding(horizontal = 4.dp),
        ) {
            Text(
                text = "Buy Ticket",
                modifier = Modifier.padding(vertical = 2.dp, horizontal = 4.dp),
                color = White,
                style = AppTheme.typography.buttonStyle,
            )
        }
    }
}

Sample Image:样本图片: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 android jetpack compose 中制作滚动条视图 - How to make scrollbar view in android jetpack compose 如何在 jetpack compose 中向 LazyVerticalGrid 添加一个 stickyHeader,例如 LazyColumn? - How can I add a stickyHeader to LazyVerticalGrid like LazyColumn in jetpack compose? 如何在 Jetpack Compose 中为文本添加点/虚线下划线? - How do I make a dotted/dashed underline for Text in Jetpack Compose? Jetpack Compose:如何绘制这样的路径/线 - Jetpack Compose: How to draw a path / line like this 我如何在android中制作这样的自定义视图 - How could i make a custom view like this in android 如何使用jetpack compose为卡片视图添加边框 - How to add border to card view with jetpack compose 如何使用jetpack compose删除卡片视图的边框 - How to remove border of card view with jetpack compose 如何将我的自定义视图迁移到 Jetpack Compose? - How to migrate my custom view to Jetpack Compose? 如何在 Jetpack Compose View 中获取测量的高度? - How to get the measured height in Jetpack Compose View? 如何在 Compose Jetpack 中创建回收站视图? - How to create recycler view in Compose Jetpack?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM