How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont w...
a
How can I remove this padding from the Outlined Text Field that is reserved to the label if I dont want to show a label? Or should I wrap it and clip its contents?
c
n
@Colton Idle here we are again 😄 I’ll add a reference to the last time people ask this question, so we can do a stack trace 😅 https://kotlinlang.slack.com/archives/CJLTWPH7S/p1622729349245100
a
@nglauber yea thanks, the background is only for you to see that theres a padding applied!
👍 1
n
Yeah… The padding will still be there 😕 I had a long discussion regarding this padding “issue” in TextField… If you want that for now, you must have to copy the
OutlinedTextField
implementation and remove the padding… 🤷‍♂️ It’s not so complicated actually, but Compose does not currently provide this right now.
a
okay, will just live with it for now and. Actually I just apply top padding to other components so they are centered vertically
think smart 1
c
If anyone creates a gist for something that allows customizing padding, please share. 😄
n
@Colton Idle I did one to remove that horizontal padding from TextField… Basically I copied the
TextField.kt
and
TextFieldImpl.kt
and did my changes… 🤷‍♂️
👍 1
But I have to say that it was very easy to do… Google, please add a single param:
horizontalMargin
and boom: everything works and we stop to see “how can I removed the padding from TextField?” 😄
a
After some thinking I really think this is a bug, if your lambda is empty or not provided, it should be rendered without a padding this could easily be done by overloading
c
n
You’re welcome 😄
This one was also fixed… 🙂 https://issuetracker.google.com/issues/187746439
3975 Views