آموزش جاوا و اندروید

یادداشت های یک برنامه نویس معمولی

آموزش جاوا و اندروید

یادداشت های یک برنامه نویس معمولی

طبقه بندی موضوعی

Button در Compose - قسمت اول

پنجشنبه, ۱۲ بهمن ۱۴۰۲، ۰۲:۱۵ ق.ظ

یک Button که در وسط یک Box قرار گرفته است.

         Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
                    Button(
                        modifier = Modifier.wrapContentSize(),
                        shape = RoundedCornerShape(topStart = 10.dp, bottomEnd = 10.dp),
                        enabled = true,
                        colors = ButtonDefaults.buttonColors(
                            containerColor = Color(0xFF2D4356),
                            contentColor = Color.Green,
                            disabledContainerColor = Color.LightGray,
                            disabledContentColor = Color.White
                        ),
                        elevation = ButtonDefaults.buttonElevation(defaultElevation = 12.dp),
                        onClick = { /*TODO*/ }) {
                        Icon(painter = painterResource(id = R.drawable.directions_bike_24), contentDescription = null)
                        Text(text = "click me!")

                    }
                }

 

موافقین ۰ مخالفین ۰ ۰۲/۱۱/۱۲
میم دال

نظرات  (۰)

هیچ نظری هنوز ثبت نشده است

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی