10-05-2010 11:24 AM
I have a KeywordFilterField inside the scrolling VFM. The background image is displayed properly however when user searches the KeywordFilterField list & only a few list rows apper the background image is only displayed behind the rows. For example if there are only 3 rows displayed in the list then the image will only be displayed behind them & not on the full screen.
Solved! Go to Solution.
10-05-2010 11:49 AM
A wild guess would be this - your scrolling VFM is created without USE_ALL_HEIGHT, and, when the field shrinks enough, it sets its own extent to use that field's height. Since any field (and Manager is a Field) can only draw in its extent area, it draws the background behind the currently shown rows.
Notice - USE_ALL_HEIGHT is dangerous if you add your VFM to a default MainScreen. I know you've read one of my posts that suggested passing NO_VERTICAL_SCROLL to MainScreen constructor - your case is the perfect example why.
So, to summarize:
1) Create new MainScreen(MainScreen.NO_VERTICAL_SCROLL)
2) Create new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR | Manager.USE_ALL_HEIGHT)
3) setBackground of your VFM if targeting 4.6+ phones; override the VFM's paintBackground() otherwise (explained in more detail in this knowledge base article - Use a background image in application screens; if you override paint/paintBackground, be sure to read the comment there)
4) add your VFM to your screen
5) add your KeywordFilterField to your VFM.
10-11-2010 09:39 PM
encountered a strange problem with this.
Using drawListRow to draw 2 lines for each record. However the first row of the list initially shows one line only.