Multiple buttons with the same width equal to the widest button

I have several ButtonFields in a VerticalFieldManager. By default, the width of each button depends on the text it contains.

I would like all buttons to have the same width - equal to the width of the widest button.

+3
source share
3 answers

Take a look at the BlackBerry Developer Knowledge Base:
How to Implement Advanced Buttons, Fields, and Managers
Last updated: February 12, 2010
Part Number: DB-00796

You are probably looking for a VerticalButtonFieldSet!

+2
source

1 - VerticalFieldManager , .

2 - , .

3 -

4 - , 1- (. setExtent)

5 - , ,

FIN

+1

Have you tried using the style flag Field.USE_ALL_WIDTH?

Try ButtonField buttonField = new ButtonField("ButtonText", Field.USE_ALL_WIDTH);

and he should use full width.

If this does not work, try extending the ButtonField, overriding the layout, and calling setExtent(width, height)with the desired width and height.

0
source

Source: https://habr.com/ru/post/1723119/


All Articles