04-16-2011 07:30 PM
I'm a rookie on blackberry development.
I have a screen that when it loads, the focus is on a button on the bottom of the screen, not showing the top of the screen. That's because the screen content is bigger than the Curve screen.
How can I put visible the top of the screen?
Here's the code:
public ptnItem(xItem item)
String sDescTratada = item.getDescription();
LabelField title = new LabelField(item.getTitle());
LabelField desc = new LabelField(sDescTratada);
LabelField data = new LabelField(item.getPubDate());
VerticalFieldManager vfmA = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
HorizontalFieldManager hfmA = new HorizontalFieldManager();
cancelButton = new ButtonField("Cancel");
linkButton = new ButtonField("Full Story");
I've tried with setFocus(), setVerticalScroll() but no success...
Solved! Go to Solution.
04-16-2011 11:29 PM - edited 04-16-2011 11:31 PM
This can be either easy or suprisingly difficult, depending on what exactly you want to achieve and on how big are your fields, most probably aDescTratada. If this string is several screens long, you'll need some careful screen position control.
However, in the simpler case one NullField is all you need. Here is a basic but good knowledge base article explaining the approach:
In your case you might want to add a NullField before the title.
However, there is a trick to the title allowing you to have it always shown on the screen - something that is quite logical in some cases and totally wrong in others. Likewise, your hfmA might or might not belong to the status area.
Take a look here for more detail:
Ask more if you are stuck.
04-21-2011 07:26 PM