When I add a label to my text field while it's on ...
# compose
c
When I add a label to my text field while it's on the screen, it shifts down just ever so slightly (to make room for the floating label text). Is there anyway to get it so that it's always at its max height so to speak even if the label is blank?
z
" "
? That works for the hint at least, havent tried with the label though.
c
I'm using outlined text field and so It unfortunately inserts a space into the outline. 🙃 Any other ideas? lol
z
Sorry but all I can think of is something super-hacky. You could create the label composable (with " ") and set its width to 0.dp, Im not sure if that renders anything, but if it does the height should be appropiate and result in the field not increasing in size when you do finally show the label.
c
Yeah. SO I ended up going the hacky route of "if the label is blank then add 8.dp of padding" and that seems to work well
¯\_(ツ)_/¯
🥲 2