Python KivyMD MDCardpost未显示多个列

Python KivyMD MDCardpost未显示多个列,python,kivy,Python,Kivy,我正在KivyMD上试着用MDCardPost 成功:我在GridLayout中添加了带有滚动条的MDCardPost。一张卡片显示在一列中 需要帮助:当我在GridLayout中更改cols:2时,MDCardPost仍显示一行中的一张卡 .kv文件片段 <windowone>: name:'winone' BoxLayout: orientation: 'vertical' spacing: dp(5) Scrol

我正在KivyMD上试着用MDCardPost

成功:我在GridLayout中添加了带有滚动条的MDCardPost。一张卡片显示在一列中

需要帮助:当我在
GridLayout
中更改
cols:2
时,MDCardPost仍显示一行中的一张卡

.kv文件片段

<windowone>:
    name:'winone'
    BoxLayout:
        orientation: 'vertical'
        spacing: dp(5)

        ScrollView:
            id: scroll
            size_hint: 1, .5
            do_scroll_x: False

            GridLayout:
                id: gri_card
                cols:2
                spacing: dp(5)
                padding: dp(5)
                size_hint: None,None
                height: self.minimum_height
class windowone(Screen):
    cards_created = False

    def on_pre_enter(self):
        def callback_for_menu_items(text_item):
            toast(text_item)

        def callback(instance, value):
            if value and isinstance(value, int):
                toast('Set like in %d stars' % value)
            elif value and isinstance(value, str):
                toast('Repost with %s ' % value)
            elif value and isinstance(value, list):
                toast(value[1])
            else:
                toast('Delete post %s' % str(instance))

        instance_grid_card = self.ids.gri_card
        buttons = ['facebook', 'vk', 'twitter']
        menu_items = [
            {'viewclass': 'MDMenuItem',
             'text': 'Example item %d' % i,
             'callback': callback_for_menu_items}
            for i in range(2)
        ]

        if not self.cards_created:
            self.cards_created = True

            instance_grid_card.add_widget(
                MDCardPost(right_menu=menu_items,
                    source="assets/kitten-1049129_1280.png",
                    tile_text="Little Baby",
                    tile_font_style="H5",
                    text_post="This is my favorite cat. He's only six months "
                              "old. He loves milk and steals sausages :) "
                              "And he likes to play in the garden.",
                    with_image=True, swipe=True, callback=callback,
                    ))
            instance_grid_card.add_widget(
                MDCardPost(right_menu=menu_items,
                    source="assets/kitten-1049129_1280.png",
                    tile_text="Little Baby",
                    tile_font_style="H5",
                    text_post="This is my favorite cat. He's only six months "
                              "old. He loves milk and steals sausages :) "
                              "And he likes to play in the garden.",
                    with_image=True, swipe=True, callback=callback,
                    ))
            instance_grid_card.add_widget(
                MDCardPost(right_menu=menu_items,
                    source="assets/kitten-1049129_1280.png",
                    tile_text="Little Baby",
                    tile_font_style="H5",
                    text_post="This is my favorite cat. He's only six months "
                              "old. He loves milk and steals sausages :) "
                              "And he likes to play in the garden.",
                    with_image=True, swipe=True, callback=callback,
                    ))
            instance_grid_card.add_widget(
                MDCardPost(right_menu=menu_items,
                    source="assets/kitten-1049129_1280.png",
                    tile_text="Little Baby",
                    tile_font_style="H5",
                    text_post="This is my favorite cat. He's only six months "
                              "old. He loves milk and steals sausages :) "
                              "And he likes to play in the garden.",
                    with_image=True, swipe=True, callback=callback,
                    ))
            instance_grid_card.add_widget(
                MDCardPost(right_menu=menu_items,
                    source="assets/kitten-1049129_1280.png",
                    tile_text="Little Baby",
                    tile_font_style="H5",
                    text_post="This is my favorite cat. He's only six months "
                              "old. He loves milk and steals sausages :) "
                              "And he likes to play in the garden.",
                    with_image=True, swipe=True, callback=callback,
                    ))