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

Native Development

Reply
New Developer
Posts: 13
Registered: ‎05-23-2014
My Device: Z10
My Carrier: WiFi

Problem when using scrollview

Hi,

 

When I'm using scrollview the image is horizontal alignment in Left  but I'm using center?!

 

 

But when delete scrollview the image is horizontal alignment in center.

 

using QML.

 

thanks.

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Problem when using scrollview

Check any Container like objects higher up in the hierarchy.

 

If not that then check that the container you are using really fills the space you think it does, set a different background colour for instance.  It's easy to get caught out with the layout changes done by Cascades.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 13
Registered: ‎05-23-2014
My Device: Z10
My Carrier: WiFi

Re: Problem when using scrollview

No Only one container.

 

import bb.cascades 1.2

Page {
    
    ScrollView {
        
        Container {

            topPadding: 20       
   	
            layout: DockLayout {}
                horizontalAlignment: HorizontalAlignment.Center
                ImageView {
                    imageSource: "asset:///images/icon.png"
                    horizontalAlignment: HorizontalAlignment.Center
                
                }
            
            }
        
        }
    
    }

 

 


 

Check any Container like objects higher up in the hierarchy.

 

If not that then check that the container you are using really fills the space you think it does, set a different background colour for instance.  It's easy to get caught out with the layout changes done by Cascades.


 

Highlighted
Developer
Posts: 543
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....
My Carrier: Telekom Slovakia

Re: Problem when using scrollview

import bb.cascades 1.2

Page {
    
    ScrollView {
        
        Container {

            topPadding: 20       
   	
            layout: DockLayout {}
                horizontalAlignment: HorizontalAlignment.Fill
                ImageView {
                    imageSource: "asset:///images/icon.png"
                    horizontalAlignment: HorizontalAlignment.Center
                
                }
            
            }
        
        }
    
    }

 



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Problem when using scrollview

As Benecore's (cheers) code demonstrates you need to make sure that the containers higher up in the hierarchy fill the space otherwise Cascades will reduce the size to fit the content.

If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
New Developer
Posts: 13
Registered: ‎05-23-2014
My Device: Z10
My Carrier: WiFi

Re: Problem when using scrollview

Thanks all for help.

 

 

When using tow ImageButton in this Container all get in center so using two Container and using topPadding that good but when click first ImageButton not work, any wrong?