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
Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

container layout

Hi,

How does container layout (with a StackLayout) take place?

 

I have a container, for which I have set the min and max height to the height of the screen. The layout direction is set TopToBottom. I add a ListView, and an empty container. The ListView takes all of the space, the empty container has 0 height. So far, so good. Now I add buttons to the empty container. As expected, the button container gets a new height, and the ListView shrinks a bit. But, I would expect (because the outer container has a fixed size) that that during the new layout process, the bottom of the button container is fixed to the botom of the outer container. Instead, the button container grows both upwards and downwards, causing half of it to be outside of the outer container. The image below shows this. I'm talking about the stuff to the right of the chess board.

 

https://dl.dropbox.com/u/219844/bb10cw2.png

please note: to make the effect more visible I have set the height of the outer container to 768-80 instead of the full screen height.

 

Any way to avoid this? Am I doing something wrong?

 

Retired
Posts: 5
Registered: ‎04-10-2012
My Device: Curve
My Carrier: Telenor

Re: container layout

Hi,

 

Since I haven't seen your code I can't know for sure, but from your description it sounds like a layout bug, i.e. your code should behave as you line out but the layoutsystem has a bug. A similar bug (most likely the same) has been fixed internally, but it's going to take some time for it to reach the Beta SDK. Unfortunately it's not going to be in the upcoming beta AFAIK, but hopefully in the next one.

 

For now I would suggest using a little less dynamic layout for that portion of the UI and move back to your original solution once the bug is fixed.

 

Sorry for the invonvenience!

 

Anders

 

 

Developer
Posts: 125
Registered: ‎06-19-2012
My Device: PlayBook + Red Z10 + BB10 Dev Alpha C
My Carrier: none

Re: container layout

Thanks. I have solved it for now by forcing the right height with setMinHeight() and setMaxHeight().