我是kivy框架的新手,正在尝试使用GridLayout创建三个列。在第3列中,我希望将元素的宽度更改为更小并向右对齐(我不想更改整个列宽),但是我的尝试没有成功。在
在主.py在
from kivy.app import App
from kivy.uix.widget import Widget
class AppCore(Widget):
pass
class TestApp(App):
def build(self):
return AppCore()
def run_app():
TestApp().run()
if __name__ == '__main__':
run_app()
在试验电压在
^{pr2}$
解决方案是在第三列中建立一个^{} ,并在该布局中设置按钮:
为了更好地显示,让我们放置背景色:
^{pr2}$尝试
size_hint_x: -0.5
而不是第三个column元素中的
width
属性。在使用GridLayout,可以使用size\u hint_x将列高度固定为特定大小。在
应用更改:
在试验电压在
希望这能有所帮助。在
相关问题 更多 >
编程相关推荐