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 Tex开发者_运维问答t Field?
commentField is consuming all horizontal space, which leaves none for the likeField. The HorizontalFieldManager defers to the fields to determine their size. You can try subclassing ActiveRichTextField to override the layout method, constraining it to a specific size. Or you can use a different manager that will not allow a field to consume all the space.
精彩评论