BoxLayout size_hint_x ignored
See original GitHub issueThe second button fills the available space, it will also do the same when it is the only children. Other layouts behave as expected in this case, they fill the space according to the size_hint value.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
kv = """
<Test>:
Button:
size_hint_x: None
width: dp(80)
Button:
size_hint_x: 0.5
"""
Builder.load_string(kv)
class Test(BoxLayout):
pass
class TestApp(App):
def build(self):
return Test()
if __name__ == '__main__':
TestApp().run()
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Kivy BoxLayout size_hint not working? - Stack Overflow
it streches to full x axis width. It stretches to full x axis only if Button is single element inside BoxLayout : it...
Read more >Size hint is not honored if set to zero · Issue #7281 · kivy/kivy
The size_hint seems to not be honored/used if it is set to 0. Only if it is the second widget inside its parent....
Read more >Solving Common Layout Problems (The Java™ Tutorials ...
The BoxLayout manager generally uses a component's preferred size (although components can be larger), and is one of the few layout managers that...
Read more >JScrollPane causes BoxLayout to ignore maximum sizes
I have a JPanel with BoxLayout with a lot of JTextPanes inside of it. The text panes have a preferred size of (600,...
Read more >Ignored class re-declaration : r/kivy - Reddit
Hello everyone, I'm currently trying to write an app that updates a list property from a back-end and shows it inside a spinner....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@werton, i’ve wrongly assumed things and i’ll bear the consequences until my last breath 😉, thanks for standing up, it’s important to challenge each other’s assumptions.
Hooray, I don’t have to write their own implementation of the BoxLayout. thanks for the discussion 😃