는 방법을 제거하는 공간을 사이에 두 개의 BoxLayouts 에서는 고급 프로그래밍?

0

질문

나는 내가 이미 답변을 읽고 다른 사용자의 이 질문에 하지만 그들 중 누구도 도움이되었습니다. 내 프로그램에서 계산기 python 과 고급 프로그래밍을 GUI 인터페이스,그는 문제는 제거할 수 있는 공간 강조 표시 에 빨간색으로 연결된 사진은 여기까지입니다. 이미 시도와 함께: size_hint: None,Nonesize: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: "="

의 크기를 조정 LabelBoxLayout 따라

2021-11-23 23:34:56

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................