如何增加列表字段所选项目的行高
我正在为我的应用程序使用 ListField
来显示列表中的数据。现在我的要求是我想增加列表中所选项目的行高。
为此,我创建了一个 GridFieldManager 并使用此管理器填充我的列表。然后我重写该管理器的 onFocus()
方法。但是,这个方法永远不会被调用。因此,我无法增加所选行项目的高度。
请帮忙。
I am using a ListField
for my app to show the data in a list. Now my requirement is that i want to increase the row height of the selected item of the list.
For this, i created a GridFieldManager
and populated my list using this manager. I then override the onFocus()
method of this manager. But, this method is never invoked. As a result i am unable to increase the height of the selected row item.
Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ListField
行均设计为统一大小,因此遗憾的是您无法直接更改一行的大小。您可以通过设置来模拟它,以便上方和下方的行分别在底部和顶部绘制一点焦点颜色。或者,您可以有一个字段仅位于焦点所在行上方的中心。然后使用所选行中的信息重新绘制此“浮动字段”。ListField
rows are all designed to be uniformly sized, so unfortunately you won't be able to directly change the size of one row. It's possible you can emulate it by setting it so that the row above and below draw a little bit of the focus color at the bottom and top respectively. Alternatively, you could have one field that just stays centered above whatever row is focused. Then redraw this "floating Field" with the information from the selected row.我成功了。我伪造了
ListField
实现。我删除了ListField
并将其替换为VerticalFieldManager
。我在onfocus()
和onUnfocus()
期间调整了其大小,并使用sublayout()
更改了该管理器的高度。它的工作方式正是我想要的。I got it working. I faked the
ListField
implementation. I removedListField
and replaced it withVerticalFieldManager
. I adjusted its size duringonfocus()
andonUnfocus()
and usedsublayout()
to change the height of this manager. Its working exactly the way i want.