第二个文本字段未显示在水平字段管理器中
下面没有显示第二个文本字段:
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);
我完全不知道为什么会出现这种情况 - 类似的 HorizontalFieldManager 可以很好地显示按钮列表。活动富文本字段有什么特别之处吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
commentField 消耗了所有水平空间,这为 likeField 留下了任何空间。 HorizontalFieldManager 根据字段来确定其大小。您可以尝试子类化 ActiveRichTextField 来重写布局方法,将其限制为特定大小。或者您可以使用不同的管理器,不允许字段占用所有空间。
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.