Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
dnepr
Posts: 723
Registered: 03-12-2009

Re: CheckboxField on the same line with OS6

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.

Please use plain text.
Developer
marcn
Posts: 53
Registered: 01-08-2009

Re: CheckboxField on the same line with OS6

 


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!

 

Please use plain text.
Developer
searingmedia
Posts: 152
Registered: 08-06-2010
My Carrier: Sasktel

Re: CheckboxField on the same line with OS6

[ Edited ]

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);
}
 }; 

 

 

Riley
Please use plain text.
Regular Contributor
fgoyti
Posts: 65
Registered: 06-15-2011
My Carrier: Bell Canada

Re: CheckboxField on the same line with OS6

Thanks - very helpful!

Please use plain text.