如何在 Jetpack Compose 列中的背景图片上添加按钮?

问题描述 投票:0回答:0

Like this 我想在列最后的图像上添加一个按钮。这是我专栏的代码。

        Column(
            modifier
                .fillMaxSize()
                .background(color = Background),
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {
            Image(
                painter = painterResource(id = R.drawable.e_logo),
                contentDescription = "Emporium Logo",
                modifier = modifier
                    .size(150.dp, 150.dp)
                    .padding(top = 39.dp)
            )
            Text(
                text = " ",
                color = Color.White,
                fontSize = 50.sp,
                textAlign = TextAlign.Center,
                fontFamily = Oswald,
                fontWeight = FontWeight.Bold
            )
            Divider(color = Color.White, thickness = 1.dp,
                modifier = modifier
                    .padding(
                        top = 10.dp,
                        bottom = 20.dp
                    )
                    .width(140.dp))

            Text(
                text = " ",
                color = Color.White,
                fontSize = 20.sp,
                textAlign = TextAlign.Center,
                fontFamily = Poppins,
                fontWeight = FontWeight.Normal,
            )

            Image(
                painter = painterResource(id  = R.drawable.dotted_design),
                contentDescription = "Dotted Design",
                contentScale = ContentScale.FillWidth,
                modifier = modifier
                    .fillMaxWidth()
                    .height(1000.dp)

            )
        }

每当我试图将按钮放在背景图像的上方或下方时,它就会移位。

android kotlin user-interface android-jetpack-compose android-jetpack
© www.soinside.com 2019 - 2024. All rights reserved.