10-18-2011 12:00 PM - edited 10-18-2011 12:01 PM
Mark, We're not done here. This fix introduced another problem. When the number of tabs exceeds the number to be displayed on the screen, the new tab needs to be scrolled into view. But with this fix, only the left edge of the new tab is scrolled onto the screen. Before, the entire text of the tab's label was scrolled onto the screen.
I'm working on it now, to find a solution.
10-18-2011 03:25 PM
Ok, I finally got it.
Instead of using a NullField, I implemented a class that extends Field.
In this new class, I implemented getPreferredWidth(), layout() and paint(). Its constructor takes the width of the tab text, which is returned by getPreferredWidth and used by layout to set the extent. Paint() draws nothing.
Instead of using a HorizontalFieldManager, I'm using a VerticalFieldManager, with the label of my text and this new field (called MyKludgeFld). The label is not Focusable, but MyKludgeFld is Focusable.
So now when the focus moves to a tab that is off screen, it scrolls the width of MyKludgeFld and brings the entire label onto the screen.
Thanks for your help Mark.
04-23-2012 02:13 AM
Please I have an issue with this, I used the same code as your and it works fine on the Simulator of 9900 7.1
but on the real device I would only the Tabs however I can not see the content of the "Active Tab" unless I Scroll down to it ( meaning unless the vfm gains focus ).
If the vfm does not have the focus I only see a WHITE background and not the content that should appear.
Thanks in advance for the help..
I am using BlackberryJDE 7.1
And the testing is on Simulator 7.1 and on Real device ...
Simulator works fine .. however Real divice shows the previous issue !
04-23-2012 02:27 AM
sorry I had amistake in the previous post !
it doesn't even work on 7.1 simulator ..same issue !
it works on simulator of 7.0 .
04-23-2012 08:37 AM
What if you programmatically gave focus to a field in your vfm?