0

I tried to design this

enter image description here

But I do not know how to do it with Textfield in jetpack compose

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented May 5, 2022 at 19:30

1 Answer 1

1

Since you need a custom TextField which is not following the Material Design, you should use a BasicTextField and customize it as you want (you need to check the parameters for that).

Here is just a start point for your implementation...

@Composable fun CustomTextField() { var text by remember { mutableStateOf("") } Card(Modifier.fillMaxWidth()) { Row( Modifier .height(IntrinsicSize.Min) ) { Icon( imageVector = Icons.Default.Search, contentDescription = null, modifier = Modifier.padding(8.dp) ) BasicTextField( value = text, onValueChange = { text = it }, Modifier .weight(1f) .padding(8.dp) ) Box( Modifier .padding(vertical = 2.dp) .width(1.dp) .fillMaxHeight() .background(MaterialTheme.colors.onBackground.copy(alpha = .5f)) ) Icon( imageVector = Icons.Default.Settings, contentDescription = null, modifier = Modifier.padding(8.dp) ) } } } 

Here is the result: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.