Можно ли изменить цвет границы .border ( при отключении? кнопка отключена и сохраняет прозрачный фон. < /p>
@Composable
fun MyButton(
modifier: Modifier = Modifier,
title: String,
isEnabled: Boolean = true,
onClick: () -> Unit
) {
Button(
modifier = modifier
.height(40.dp)
.border(
width = 1.dp,
color = Color.Red,
shape = RoundedCornerShape(16.dp)
)
.background(
color = Color.Transparent,
shape = RoundedCornerShape(16.dp),
),
shape = RoundedCornerShape(16.dp),
onClick = onClick,
elevation = ButtonDefaults.elevation(
defaultElevation = 0.dp,
pressedElevation = 0.dp,
hoveredElevation = 0.dp
),
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Transparent,
disabledBackgroundColor = Color.Transparent,
contentColor = Color.White,
disabledContentColor = Color.Gray
),
enabled = isEnabled
) {
Text(text = title)
}
}
Подробнее здесь: https://stackoverflow.com/questions/766 ... f-it-is-en