Blackberry- how to make ListField Headers above each row
So i have a custom ListField class, and it looks prett开发者_Go百科y boring with no headers. Does anyone know if there is a way to make headers above each cell? I am used to iphone programming which made this very easy.
There isn't a built-in feature, but you can just add a Field above it, or use yourScreen.setTitle()/setBanner() if you want it to remain on the screen regardless of scroll position.
- Replace the ListField with a VerticalFieldManager to contain your rows.
- Move the draw code of your rows from the ListView to a custom Field class's paint method. Or if it's a simple text row, use a LabelField.
- Create another custom Field to contain your headers, or use another LabelField.
- Add headers and rows to the VerticalFieldManager in the order you want them to appear.
精彩评论