कैसे को दूर करने के लिए अंतरिक्ष के बीच दो BoxLayouts में Kivy?

0

सवाल

मैं राज्य है कि मैं पहले से ही जवाब पढ़ने के लिए अन्य उपयोगकर्ताओं के लिए इस सवाल है, लेकिन उनमें से कोई भी मेरी मदद की. मैं कोशिश कर रहा हूँ करने के लिए कार्यक्रम में एक कैलकुलेटर अजगर के साथ kivy जीयूआई इंटरफेसहै,वह समस्या है कि मैं नहीं कर सकते दूर है कि अंतरिक्ष पर प्रकाश डाला में लाल रंग में संलग्न फोटो यहाँ नीचे. मैं पहले से ही है के साथ की कोशिश की: size_hint: None,None और size:root.size[0], "5dp" पैमाने पर करने के लिए BoxLayouts लेकिन यह काम नहीं करता है

         [1]: https://i.stack.imgur.com/y1ZwF.png


  BoxLayoutExample:
<BoxLayoutExample>:
    orientation: "vertical"
    Label:
        text: "0"
        font_size: "30dp"
    BoxLayout:
        orientation: "horizontal"
        Button:
            text: "7"
            size_hint: .1, .3
        Button:
            text: "4"
            size_hint: .1, .3
        Button:
            text: "1"
            size_hint: .1, .3

    BoxLayout:
        orientation: "horizontal"
        Button:
            text: ","
            size_hint: .1, .3
        Button:
            text: "0"
            size_hint: .1, .3
        Button:
            text: "="
            size_hint: .1, .3
       
calculator interface kivy python
2021-11-23 20:37:05
1

सबसे अच्छा जवाब

0

आपकी समस्या यह है कि आप स्थापित कर रहे हैं size_hint बटन के सापेक्ष करने के लिए अपने माता पिता के BoxLayout. तो प्रभाव में, अपने BoxLayout के ऊपर ले जा रहे हैं के लिए 1/3 के उपलब्ध स्थान (क्योंकि वहाँ तीन विगेट्स कर रहे हैं में BoxLayoutExample.

यहाँ है कि कैसे इसे ठीक करने के लिए:

<BoxLayoutExample>:
    orientation: "vertical"

    Label:
        text: "0"
        font_size: "30dp"
        size_hint: 1, .8

    BoxLayout:
        orientation: "horizontal"
        size_hint: 1, .1
        Button:
            text: "7"
        Button:
            text: "4"
        Button:
            text: "1"

    BoxLayout:
        orientation: "horizontal"
        size_hint: 1, .1
        Button:
            text: ","
        Button:
            text: "0"
        Button:
            text: "="

के आकार को समायोजित Label और BoxLayout तदनुसार

2021-11-23 23:34:56

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

इस श्रेणी में लोकप्रिय

लोकप्रिय सवाल इस श्रेणी में