07-08-2012 02:06 AM
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.
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?
07-09-2012 06:55 AM
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!