Material Design implementation in Jetpack compose of a TextField
Questions tagged [android-compose-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
affan ahmad
- 299
- 2
- 10
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?
Trinity
- 826
- 1
- 10
- 28
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 =…
nglauber
- 2,430
- 17
- 22
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…
Malik Motani
- 3,099
- 3
- 25
- 49
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?
Hassa
- 119
- 7
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…
Christer
- 1,689
- 1
- 23
- 42
3
votes
2 answers
Jetpack Compose: Disable Interaction with TextField
Is there a way to disable all interaction for Jetpack Compose's TextField?
Archie G. Quiñones
- 5,945
- 5
- 32
- 71
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?
Constantin
- 621
- 5
- 7
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))
…
Lucas
- 1
- 1
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…
Praveen P.
- 331
- 2
- 10
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