Reputation: 2744
How does one align hintText
to the top in a TextField
?
TextField (
decoration: InputDecoration(
hintText: 'align me to the top',
),
),
textAlign
is not affecting hintText
at all.TextStyle
does not have Align
property as hintStyle
can be used.Upvotes: 1
Views: 4624
Reputation: 95
TextField (
textAlign: TextAlign.center,
decoration: InputDecoration(
hintText: 'align me to the top',
),
),
Upvotes: 0
Reputation: 40513
You may have to update with an image of what you want if this doesn't do it, but I think that it might be as simple as using labelText
rather than hintText
.
This is the position of the the various text you can add:
This is what label looks like when there's no hint, the input isn't selected, and there's no text:
And this is what Label looks like when there's text or it's selected.
Upvotes: 1