I have 2 Text
, first one is a normal text, so I wrote it in Text
, but the second one is a user-changeable text, and I wrote it as OutLineTextField
and customized it according to myself, but
Row(
modifier = modifier
.fillMaxWidth()
.padding(15.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
)
still does not justify the text of the OutLineTextField
, that is, the text on the right, exactly to the right. What is the reason of this ?
I want the name "johnny bravo" and the date of birth "2002-03-02" justified to the right but not as you can see
hear is my code :
@Composable
fun ProfileSettingsUserTextItem(
text1: String,
text2: String,
isMailText: Boolean
) {
var text by remember { mutableStateOf(text2) }
Row(
modifier = Modifier
.fillMaxWidth()
.padding(15.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
Column(modifier = Modifier.weight(3f)) {
Text(text = text1)
}
if (isMailText) {
Text(
text = text2,
color = Color.Gray,
)
} else {
Row(modifier = Modifier
.fillMaxWidth()
.weight(3f)
.background(Color.Green)) {
OutlinedTextField(
value = text,
onValueChange = { text = it },
textStyle = MaterialTheme.typography.subtitle2,
colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
Color.Black.copy(alpha = 0.5f)
),
shape = MaterialTheme.shapes.small,
singleLine = true,
keyboardOptions = KeyboardOptions.Default.copy(
imeAction = ImeAction.Done,
keyboardType = KeyboardType.Text,
)
)
}
}
}
}