本文介绍了Kivy GridLayout错误:未设置列或行,未触发布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试制作一个简单的应用,该应用需要名称,等级,语言(仅用于练习).
I'm trying to make a simple app that takes name, grade, language (just for practice).
以下是代码:
:You are getting that error because you are not setting cols or rows for a GridLayout. In this case, the GridLayout in question is the one created by:
self.top_grid = GridLayout()解决方法是为该GridLayout设置cols或rows.尝试添加如下一行:
The fix is to set cols or rows for that GridLayout. Try adding a line like:
self.top_grid.cols = 2就在创建self.top_grid之后.
这篇关于Kivy GridLayout错误:未设置列或行,未触发布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!