0

The following doesn't show the second text field:

HorizontalFieldManager innerHfmComment = 
    new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);

ActiveRichTextField commentField = 
    new ActiveRichTextField("Comment", Field.FOCUSABLE){};
ActiveRichTextField likeField = 
    new ActiveRichTextField("Like", Field.FOCUSABLE){};

innerHfmComment.add(commentField);
innerHfmComment.add(likeField);

I'm completely lost as to why this is the case - a similar HorizontalFieldManager can display a list of buttons just fine. Is there something special about Active Rich Text Field?

4

1 回答 1

2

commentField 占用了所有水平空间,没有给 likeField 留下任何空间。Horizo​​ntalFieldManager 根据字段确定它们的大小。您可以尝试继承 ActiveRichTextField 以覆盖布局方法,将其限制为特定大小。或者,您可以使用不允许字段占用所有空间的其他管理器。

于 2010-11-04T21:33:33.020 回答