开发者

Update the setTitle for a ListField

Hi developers I am working on a app where I need to set title for a listField which contains 100 listItems. For each 20 items I need to change the title at run time. My class is extending MainScreen and I can able to set title for only one time only. While scrolling the items in it I am not able 开发者_如何学编程to update the title with new one.Each 20 elements are parsing values coming from xml file. How can I implement it.


Ok, looks like I got your trouble - you don't know how to detect whether user has scrolled to 21st (41st, 61st, etc.) list item.

I think it is possible to track the currently visible list items from the ListFieldCallback.drawListRow(ListField listField, Graphics graphics, int index, int y, int width) method. Note that index is "Row index to display". So in theory you should be able to call MainScreen.setTitle(String title) from the drawListRow() if index == 21 (41, 61, etc.).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜