08-10-2010 02:26 PM
Fyi. It looks like the field by default uses USE_ALL_WIDTH. Overriding layout and passing getPreferredWidth() instead of actual width, will only give it as much room as it needs thus fixing this issue.
Using this fix I can't tell the difference between 6.0 render and 5.0.
08-10-2010 02:34 PM
dnepr wrote:
Fyi. It looks like the field by default uses USE_ALL_WIDTH. Overriding layout and passing getPreferredWidth() instead of actual width, will only give it as much room as it needs thus fixing this issue.
Using this fix I can't tell the difference between 6.0 render and 5.0.
I can confirm that this fix works - very nice and simple... thank you so much!
03-21-2011 10:11 PM - edited 03-21-2011 10:12 PM
Works for me too... here's some sample code:
CheckboxField myBox = new CheckboxField("My Box", false, CheckboxField.FIELD_LEFT){
protected void layout(int width, int height) {
super.layout(this.getPreferredWidth(), height);
}
};
07-27-2011 11:47 AM
Thanks - very helpful!