开发者

Second text field not showing up in horizontal field manager

开发者 https://www.devze.com 2023-01-23 08:08 出处:网络
The following doesn\'t show the second text field: HorizontalFieldManager innerHfmComment = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消