开发者

How to add a field at a fixed position in Blackberry?

I am curious to see if it's possible to display a Field at a fixed position on the screen and at the bottom most layer so any other Manager or Field paints over it, 开发者_如何转开发except the background of the Screen. As if that field is added to the background of the Screen, but is displayed on top of the actual background that can be set using Screen.setBackground(). Is there any specific Manager that can achieve this? Or a combination of them? As far as I can see there can't be overlaps between Manager layouts. Is this true?


You could make a custom manager that does this. It would have two Java fields of type Field, plus an XYRect to keep track of the positioning for the fixed field.

Then in the sublayout method, set the position for your fixed field and layout the overlay field. And in the subpaint method, make sure your fixed field is painted first, then the overlay field gets painted on top.

When using your custom manager, the second field can be anything, such as another manager. This solves your overlapping manager problem.

You didn't say whether you wanted special focus behavior, but your custom manager could take care of that too, if necessary.


You can also checkout AbsoluteFieldManager

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜