0
Sc.kv按鈕沒有調整到適合文本(Kivy)
<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'
和ScApp.py
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
class Selector(Widget): pass
class ScLayout(GridLayout): pass
class ScApp(App):
def build(self):
pass
if __name__ == '__main__':
ScApp().run()
我想要的按鈕來調整大小以適合文本的大小,但是什麼代之以: (not enough rep to embed images!)
爲什麼會發生這種情況?以及我該如何解決這個問題?
如果我做了'