Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
morpheusghost
Posts: 34
Registered: ‎07-30-2010
My Device: Not Specified
Accepted Solution

How to scroll vertically and horizontally the entire screen?

Hi!

i have a screen which displays an image that is big enough! My problem is that  i can't scroll it horizontally and vertically to see the whole image! I tried several things but nothing worked!! I've searched the forum but nothing helped. Here is my code:

 

Manager hfm = new HorizontalFieldManager();
        hfm.add(new NullField(NullField.FOCUSABLE));
        image = new BitmapField(Bitmap.createBitmapFromBytes(array, 0,-1,1));
        hfm.add(image);
        hfm.add(new NullField(NullField.FOCUSABLE));
        add(hfm);

 

 

 

I tried to create a verticalFieldManager and add it to hfm but nothing!! I also tried to add it into screen but no luck either!! The class extends MainScreen.

 

Any suggestions plz???

Thnx in advance!!

Developer
wpbbmg
Posts: 83
Registered: ‎02-19-2010
My Device: Not Specified

Re: How to scroll vertically and horizontally the entire screen?

Do you try: 

new HorizontalFieldManager(VERTICAL_SCROLL | HORIZONTAL_SCROLL);

??

 

Regards

Developer
WesleyT
Posts: 206
Registered: ‎07-02-2010
My Device: 8320 Curve

Re: How to scroll vertically and horizontally the entire screen?

try this

 

 

HorizontalFieldManager _HHistoryManager = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | VERTICAL_SCROLLBAR)
            {
                   public void sublayout(int width,int height)
                   {
                      super.sublayout(195, 140);
                   }
             };    

 

 

Contributor
morpheusghost
Posts: 34
Registered: ‎07-30-2010
My Device: Not Specified

Re: How to scroll vertically and horizontally the entire screen?

@wpbbmg

I already tried that with no luck :smileysad:

 

@ wesleyT

No nothing happened

 

Thnx for the quick reply!!!

Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm

Re: How to scroll vertically and horizontally the entire screen?

make ur bitmap field focusable,may be it helps u then with code provided by others

Contributor
morpheusghost
Posts: 34
Registered: ‎07-30-2010
My Device: Not Specified

Re: How to scroll vertically and horizontally the entire screen?

no luck!! There is no scrolling at all.

Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm

Re: How to scroll vertically and horizontally the entire screen?

try to create custom manger

may be this helps else let me try

New Developer
krishnaprabhu
Posts: 4
Registered: ‎07-23-2010
My Device: Not Specified

Re: How to scroll vertically and horizontally the entire screen?

[ Edited ]

Please see if this post helps you!!!

Developer
Ekansh
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm

Re: How to scroll vertically and horizontally the entire screen?

hi, add null fields at the position/end of the layout of your manager.

 

using

 

protected void sublayout(int width,int height)
    {

      layoutChild(null1, getPreferredWidth(), getPreferredHeight());
                        
       setPositionChild(null1,240,260);

       super.setExtent(240,260);

   }

 

 

Thanks

Ekansh                      

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to scroll vertically and horizontally the entire screen?