按钮未调整大小以适应文本(Kivy)

2024-10-01 15:42:19 发布

您现在位置:Python中文网/ 问答频道 /正文

在千伏在

<Selector>:
    pos: 200, 400

<ScLayout>:
    cols: 2
    pos: self.parent.pos
    spacing: 10

<Button>:
    width: len(self.text) * 50

FloatLayout:
    Selector:
        ScLayout:
            Button:
                text: 'hey'
            Button:
                text: 'welcome'
            Button:
                text: 'hi'
            Button:
                text: 'how are you'

以及肩胛骨在

^{pr2}$

我希望按钮调整大小以适应文本的大小,但是会发生什么情况: (not enough rep to embed images!)

为什么会这样?,我怎样才能修好它?在


Tags: textposselflenbuttonhiwidthselector

热门问题