05-01-2012 03:47 PM
I'm working on a GUI having some BasicEditFields.
The screen has several Manager's, buttons and so forth.
After changing the text of the field, getContentHeight() returns a larger value.
I have specified padding and font, but the content height changes with the text field.
Is there any way to have a fix size for my BasicEditField that will not vary according to the text content?
05-01-2012 04:34 PM
BasicEditField's height will change if text is longer than one line. If you want a fixed display height add it inside a fixed height manager.
05-01-2012 04:39 PM
In this case, the text changes are all within 1 line of text.
05-01-2012 04:55 PM
Also, it is not possible to override getContentHeight() (it's marked as final).
Overriding getPreferredHeight() gives me the same problem: my preferences are ignored and the BasicEditField getContentHeight() returns a variable value. (Sometimes 37, sometimes 38)
05-01-2012 04:58 PM
What about getHeight method? does that also give different value?
You can fix the height of the field by overriding layout method.