Questions tagged [android-compose-textfield]

Material Design implementation in Jetpack compose of a TextField

12 questions
10
votes
6 answers

TextField with hint text in jetpack compose

I want to create textfield with hint text in jetpackcompose. Any example how create textfield using jectpack? Thanks
8
votes
4 answers

How to remove indicator line of TextField in Androidx Compose Material?

I would like to remove the purple line/indicator (see the following image) of TextField. Is that possible or should I create my own custom TextField to achieve that?
8
votes
3 answers

How to close the virtual keyboard from a Jetpack Compose TextField?

I'm using the Jetpack Compose TextField and I want to close the virtual keyboard when the user press the the action button (imeActionPerformed parameter). val text = +state { "" } TextField( value = text.value, keyboardType =…
6
votes
4 answers

How to use EditText or TextInput widget in Jetpack compose?

I was exploring Jetpack compose by trying a few widgets like Image and EditText. For text input, it has EditableText. I have tried below code but it is not showing anything in UI class MainActivity : AppCompatActivity() { override fun…
4
votes
2 answers

How to set the inputType for a TextField in Jetpack Compose

I'd like to restrict what the user can type in a TextField in Jetpack Compose. How do I do that? The equivalent in xml is inputType:
Cristan
  • 6,550
  • 4
  • 45
  • 46
3
votes
1 answer

Exposed drop-down menu for jetpack compose

I was wondering if there is a solution for Exposed drop-down menu for jetpack compose? I couldn't find a proper solution for this component inside jetpack compose. Any help?
3
votes
2 answers

Jetpack Compose how to remove EditText/TextField underline and keep cursor?

Hi I need to remove the underline in my TextField because it look ugly when the TextField is circular. I have sat the activeColor to transparent, but then the cursor wont show (because it's transparent). How can I remove the underline/activeColor…
3
votes
2 answers

Jetpack Compose: Disable Interaction with TextField

Is there a way to disable all interaction for Jetpack Compose's TextField?
1
vote
1 answer

How can I disable FilledTextField component?

How can I disable FilledTextField component like a Button or something else? Are there some modifier or some wrapper to switch disable/enable state of UI components in Android Jetpack Compose?
0
votes
2 answers

Is there anyway to center text within a TextField horizontally and vertically?

In Android compose is there anyway to center text within a TextField? TextField( value = text, onValueChange = setText, maxLines = 2, modifier = modifier .clip(RoundedCornerShape(10.dp)) …
0
votes
1 answer

TextField not updating when applying State Hoisting

I am building a simple app following Mitch Tabian's youtube tutorial about Jetpack Compose. In the State Hoisting video, he extracts the code for the search TextField into a separate Composable. When I do so, my textField doesn't update the value…
0
votes
1 answer

How to pass android compose material icons to textField

I want to use material icons as argument passing it to the textField. @Composable fun NormalTextField( icon: () -> Unit, // how to pass material icon to textField label: String ) { val (text, setText) = mutableStateOf("") …
ccd
  • 2,488
  • 1
  • 15
  • 38