Blackberry jumpy scroll

I'm having issues with vertical scrolling in a BlackBerry app. It works great on touch screens, but when scrolling with a track, it jumps from top to bottom.

Has anyone had a similar problem? any idea what i could try?

Here is a snippet of my code. I have a static background image and the fields scroll over it:

vertical_main = new VerticalFieldManager(USE_ALL_WIDTH |NO_VERTICAL_SCROLL |USE_ALL_HEIGHT); vertical_AllTags=new VerticalFieldManager(USE_ALL_WIDTH | VERTICAL_SCROLL); // i then add all the fields to vertical_AllTags vertical_main.add(vertical_AllTags); vertical_main.invalidate(); add(vertical_main); 

in advance for your help

EDIT: The suggestion to give every field focus was right. the only other part that needs to be done is when you override the onFocus method for the field, you need to call the super () function so that all the other normal parts of the onFocus method are still called:

 protected void onFocus(int direction) { text_select=true; invalidate(); super.onFocus(direction); } protected void onUnfocus() { text_select=false; invalidate(); super.onUnfocus(); } 

Thank you very much.

+4
source share
3 answers

This is a common problem in new products for touch devices. if you want to scroll a field across a field, there are two ways:

1), you should pay attention to all fields, then it will focus focus down

another way means you don't need to focus on every field

2) just add a NullField after each field and focus on all NullFields, then your trackball will call the screen field by field

+1
source

This happens in the TrackWheel scroll, scrolling it to the next Focused field. I think you are not focusing between vertical_AllTags .

You can solve this using the NullField () class. How...

 add(new NullField(Field.FOCUSABLE)) 

when you add add (new NullField (Field.FOCUSABLE)); you will get zero focus that you don’t know. And you can navigate through all fields, such as the touch screen.

+1
source

You can solve this problem by adding two vertical field managers. Look at the code in this post

0
source

Source: https://habr.com/ru/post/1386219/


All Articles