Unable to find TableRecycleGridLayout to fix Kivy code(找不到 TableRecycleGridLayout 来修复 Kivy 代码)
问题描述
尝试在 KivyMD 中创建表时出错
I'm getting an error trying to create a table in KivyMD
ValueError:TableRecycleGridLayout.orientation 设置为无效选项垂直".必须是以下之一:['lr-tb', 'tb-lr', 'rl-tb', 'tb-rl', 'lr-bt', 'bt-lr', 'rl-bt', 'bt-rl']
它告诉我我需要将方向更改为垂直"以外的方向,但我在任何地方都找不到.
It's telling me I need to change orientation to something other than 'vertical' but I can't find it anywhere.
推荐答案
我找到了一个解决方法,即从TableRecycleGridLayout:"中删除orientation:'vertical'.在kivymd/uix/datatables.py中如下图:
I found a fix which was to simply remove orientation:'vertical' from "TableRecycleGridLayout:" in kivymd/uix/datatables.py as shown below:
TableRecycleGridLayout:
id: row_controller
key_selection: "selectable"
cols: root.total_col_headings
cols_minimum: root.cols_minimum
default_size: None, dp(52)
default_size_hint: 1, None
size_hint: None, None
height: self.minimum_height
width: self.minimum_width
multiselect: True
touch_multiselect: True
现在运行您的程序.分享您的意见.
Now run your program. Share your comments.
这篇关于找不到 TableRecycleGridLayout 来修复 Kivy 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:找不到 TableRecycleGridLayout 来修复 Kivy 代码


基础教程推荐
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 筛选NumPy数组 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01