How To Position Boxlayout To Top Of Screen
I have a ActionBar that is nested inside a BoxLayout widget. I'd like the ActionBar to appear at the very top of the screen. Currently, I'm only able to get it to appear at the ver
Solution 1:
Your example is actually a little too simple - you'll get the right behaviour as soon as you add another widget. For instance, here's a new rule for your widget:
<ShowActionBar>:orientation:"vertical"ActionBar:ActionView:use_seperator:TrueActionPrevious:title:"My Title"with_previous:FalseActionOverflow:ActionButton:text:"Settings"ActionButton:text:"Log Out"Label:text:'the next widget added fills all the extra space'text_size:self.sizehalign:'center'valign:'middle
Note that I also removed the unnecessary BoxLayout level.
The real problem is that BoxLayout ignores the pos_hint when it has just one child. Maybe it counts as a bug, but at best only a small one, since it isn't really intended to deal with a single child of fixed size - a FloatLayout would be more appropriate for this. However, a BoxLayout is probably exactly what you want once you do add more children.
Post a Comment for "How To Position Boxlayout To Top Of Screen"