首页 > 解决方案 > 警告在下一帧之前完成了太多迭代

问题描述

为什么当我将 screen2 中的按钮更改为 MDRaisedButton 时,我会不停地收到此警告,而当我删除 size_hint 时却没有警告?

Blockquote [CRITICAL] [Clock ] 警告,在下一帧之前完成了太多迭代。检查您的代码,或增加 Clock.max_iteration 属性

当我移动到 screen2 时,警告停止。

MDBottomNavigation:

    MDBottomNavigationItem:
    name: 'screen1'

    MDBoxLayout:
        size: self.size
        pos: self.pos
        orientation: 'vertical'


        MDGridLayout:
            cols: 2
            rows: 4

            MDLabel:
                text: '1'
                size_hint: 0.2, 0.1

            MDRaisedButton:
                size_hint: 0.2, 0.1


    MDBottomNavigationItem:
    name: 'screen2'

    MDBoxLayout:
        size: self.size
        pos: self.pos
        orientation: 'vertical'

        MDGridLayout:
            cols: 2
            rows: 4

            MDLabel:
                text: '2'
                size_hint: 0.2, 0.1

            MDRaisedButton:
                size_hint: 0.2, 0.1

标签: kivykivymd

解决方案


推荐阅读