I want to have a header and a footer on a popup and a scrollable body between them. I don't really have a problem with the header, as I will add the header field first and make it not scrollable, then I will add a scrollable VerticalFieldManager
for the body. The problem is adding the footer, as the size of the content on t开发者_StackOverflow中文版he popup is not known.
I know that for MainScreen
we have setTitle(Field)
and setStatus(Field)
for setting the header and footer, but for PopupScreen we don't have anything similar.
I am targeting Blackberry OS 4.5 and above.
The best way is to write your own Manager to exactly accommodate your needs. It's not that hard.
Here's a good tutorial from a blog that talks about a generic model with title, interior VFM and footer:
http://www.thinkingblackberry.com/archives/188
If you search for "custom Manager" on the RIM forums there is more source code floating around.
All you really have to implement in a Manager is the sublayout() method, which is where you call layoutChild(f, width, height) on all your fields and then setPositionChild() to exactly place them. That way you get complete power over where they go.
Then you just construct your PopupScreen with your new custom Manager as the delegate.
精彩评论