久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <small id='kLVZs'></small><noframes id='kLVZs'>

    2. <tfoot id='kLVZs'></tfoot>
      • <bdo id='kLVZs'></bdo><ul id='kLVZs'></ul>

      <legend id='kLVZs'><style id='kLVZs'><dir id='kLVZs'><q id='kLVZs'></q></dir></style></legend>
      <i id='kLVZs'><tr id='kLVZs'><dt id='kLVZs'><q id='kLVZs'><span id='kLVZs'><b id='kLVZs'><form id='kLVZs'><ins id='kLVZs'></ins><ul id='kLVZs'></ul><sub id='kLVZs'></sub></form><legend id='kLVZs'></legend><bdo id='kLVZs'><pre id='kLVZs'><center id='kLVZs'></center></pre></bdo></b><th id='kLVZs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kLVZs'><tfoot id='kLVZs'></tfoot><dl id='kLVZs'><fieldset id='kLVZs'></fieldset></dl></div>
    3. 如何將多列放入 kivy RecycleView?

      How to put multiple columns into a kivy RecycleView?(如何將多列放入 kivy RecycleView?)
      • <i id='t35FA'><tr id='t35FA'><dt id='t35FA'><q id='t35FA'><span id='t35FA'><b id='t35FA'><form id='t35FA'><ins id='t35FA'></ins><ul id='t35FA'></ul><sub id='t35FA'></sub></form><legend id='t35FA'></legend><bdo id='t35FA'><pre id='t35FA'><center id='t35FA'></center></pre></bdo></b><th id='t35FA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='t35FA'><tfoot id='t35FA'></tfoot><dl id='t35FA'><fieldset id='t35FA'></fieldset></dl></div>
          <bdo id='t35FA'></bdo><ul id='t35FA'></ul>
            <tbody id='t35FA'></tbody>

          <tfoot id='t35FA'></tfoot>

            <legend id='t35FA'><style id='t35FA'><dir id='t35FA'><q id='t35FA'></q></dir></style></legend>

            <small id='t35FA'></small><noframes id='t35FA'>

              • 本文介紹了如何將多列放入 kivy RecycleView?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我想將(csv-)表的數據放入 kivy recycleview.

                如果我將固定文本分配給 kv 中的標簽,我設法在一行中插入多個列,但我無法讓它用字典列表中的數據填充標簽.到目前為止,這是我用來測試概念的代碼:

                from kivy.app import App從 kivy.lang 導入生成器從 kivy.uix.recycleview 導入 RecycleView從 kivy.uix.boxlayout 導入 BoxLayout導入 csvitems = [{'SP1': 'Artikelnummer', 'SP2': '姓名', 'SP3': 'Groesse'},{'SP1': '510001', 'SP2': '大泵', 'SP3': '1.50 L'},{'SP1':'523001','SP2':'Leonie Still','SP3':'1.50 L'},{'SP1':'641301','SP2':'可樂混合','SP3':'1.50 L'}]類表(BoxLayout):def __init__(self, **kwargs):super(Tabelle, self).__init__(**kwargs)def insert_SP(自我,數據):對于數據中的 i:self.spalte1_SP = i['SP1']#print(self.spalte1_SP)self.spalte2_SP = i['SP2']self.spalte3_SP = i['SP3']builder.load_string('''<塔貝爾>:方向:水平"spalte1_SP: 'spalte1'spalte2_SP: 'spalte2'spalte3_SP: 'spalte3'標簽:編號:Spalte1文本:root.spalte1_SP標簽:編號:Spalte2文本:root.spalte2_SP標簽:編號:Spalte3文本:root.spalte3_SP<房車>:視圖類:塔貝爾"回收箱布局:default_size:無,dp(20)default_size_hint:1,無size_hint_y:無高度:self.minimum_height方向:垂直"''')房車類(回收視圖):def __init__(self, **kwargs):超級(房車,自我).__init__(**kwargs)#self.data = []x = 表()x.insert_SP(項目)類測試應用程序(應用程序):定義構建(自我):返回 RV()如果 __name__ == '__main__':TestApp().run()

                我希望在 3 列中看到來自 items 的數據,但由于某種原因它們保持為空.

                解決方案

                它是空的,因為 data 沒有填充.

                解決方案

                • 刪除 class Tabelle()
                • 中的所有編碼
                • pass 添加到 class Tabelle()
                • 將以下內容添加到 class RV()
                • 的構造函數中,__init__()

                片段

                self.data = [{'spalte1_SP': str(x['SP1']), 'spalte2_SP': str(x['SP2']), 'spalte3_SP': str(x['SP3'])} for x in items]

                I want to put the data of a (csv-)table into a kivy recycleview.

                I managed to insert multiple columns with one row, if i assign a fixed text to the Labels in the kv, but i can't get it to fill the labels with data from a dictionary list. This is the code so far, that i use to test the concept:

                from kivy.app import App
                from kivy.lang import Builder
                from kivy.uix.recycleview import RecycleView
                from kivy.uix.boxlayout import BoxLayout
                import csv
                
                items = [{'SP1': 'Artikelnummer', 'SP2': 'Name', 'SP3': 'Groesse'},
                    {'SP1': '510001', 'SP2': 'Big Pump', 'SP3': '1.50 L'},
                    {'SP1': '523001', 'SP2': 'Leonie Still', 'SP3': '1.50 L'},
                    {'SP1': '641301', 'SP2': 'Cola Mix', 'SP3': '1.50 L'}
                ]
                
                class Tabelle(BoxLayout):
                    def __init__(self, **kwargs):
                        super(Tabelle, self).__init__(**kwargs)
                
                    def insert_SP(self, data):
                        for i in data:
                            self.spalte1_SP = i['SP1']
                            #print(self.spalte1_SP)
                            self.spalte2_SP = i['SP2']
                            self.spalte3_SP = i['SP3']
                
                Builder.load_string('''
                <Tabelle>:
                    orientation: 'horizontal'
                    spalte1_SP: 'spalte1'
                    spalte2_SP: 'spalte2'
                    spalte3_SP: 'spalte3'
                    Label:
                        id: Spalte1
                        text: root.spalte1_SP
                    Label:
                        id: Spalte2
                        text: root.spalte2_SP
                    Label:
                        id: Spalte3
                        text: root.spalte3_SP
                
                <RV>:
                    viewclass: 'Tabelle'
                    RecycleBoxLayout:
                        default_size: None, dp(20)
                        default_size_hint: 1, None
                        size_hint_y: None
                        height: self.minimum_height
                        orientation: 'vertical'
                ''')
                
                class RV(RecycleView):
                    def __init__(self, **kwargs):
                        super(RV, self).__init__(**kwargs)
                        #self.data = []
                        x = Tabelle()
                        x.insert_SP(items)
                
                class TestApp(App):
                    def build(self):
                        return RV()
                
                if __name__ == '__main__':
                    TestApp().run()
                

                I expect to see the data from items in 3 columns, but they stay empty for some reason.

                解決方案

                It is empty because data was not populated.

                Solution

                • Remove all codings in class Tabelle()
                • Add pass into class Tabelle()
                • Add the following into constructor, __init__() of class RV()

                Snippets

                self.data = [{'spalte1_SP': str(x['SP1']), 'spalte2_SP': str(x['SP2']), 'spalte3_SP': str(x['SP3'])} for x in items]
                

                Kivy RecycleView ? data

                The view is generatad by processing the data, essentially a list of dicts, and uses these dicts to generate instances of the viewclass as required.

                data
                

                The data used by the current view adapter. This is a list of dicts whose keys map to the corresponding property names of the viewclass.

                data is an AliasProperty that gets and sets the data used to generate the views.

                Example

                main.py

                from kivy.app import App
                from kivy.lang import Builder
                from kivy.uix.recycleview import RecycleView
                from kivy.uix.boxlayout import BoxLayout
                
                items = [{'SP1': 'Artikelnummer', 'SP2': 'Name', 'SP3': 'Groesse'},
                         {'SP1': '510001', 'SP2': 'Big Pump', 'SP3': '1.50 L'},
                         {'SP1': '523001', 'SP2': 'Leonie Still', 'SP3': '1.50 L'},
                         {'SP1': '641301', 'SP2': 'Cola Mix', 'SP3': '1.50 L'}
                         ]
                
                
                class Tabelle(BoxLayout):
                    pass
                
                
                Builder.load_string('''
                <Tabelle>:
                    orientation: 'horizontal'
                    spalte1_SP: 'spalte1'
                    spalte2_SP: 'spalte2'
                    spalte3_SP: 'spalte3'
                    Label:
                        id: SP1
                        text: root.spalte1_SP
                    Label:
                        id: SP2
                        text: root.spalte2_SP
                    Label:
                        id: SP3
                        text: root.spalte3_SP
                
                <RV>:
                    viewclass: 'Tabelle'
                    RecycleBoxLayout:
                        default_size: None, dp(20)
                        default_size_hint: 1, None
                        size_hint_y: None
                        height: self.minimum_height
                        orientation: 'vertical'
                ''')
                
                
                class RV(RecycleView):
                    def __init__(self, **kwargs):
                        super(RV, self).__init__(**kwargs)
                        self.data = [{'spalte1_SP': str(x['SP1']), 'spalte2_SP': str(x['SP2']), 'spalte3_SP': str(x['SP3'])} for x in items]
                
                
                class TestApp(App):
                    def build(self):
                        return RV()
                
                
                if __name__ == '__main__':
                    TestApp().run()
                

                Output

                這篇關于如何將多列放入 kivy RecycleView?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                message.channel.id Discord PY(message.channel.id Discord PY)
                How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <bdo id='dXBYb'></bdo><ul id='dXBYb'></ul>

                  <small id='dXBYb'></small><noframes id='dXBYb'>

                      1. <tfoot id='dXBYb'></tfoot>
                      2. <legend id='dXBYb'><style id='dXBYb'><dir id='dXBYb'><q id='dXBYb'></q></dir></style></legend>
                          <tbody id='dXBYb'></tbody>
                      3. <i id='dXBYb'><tr id='dXBYb'><dt id='dXBYb'><q id='dXBYb'><span id='dXBYb'><b id='dXBYb'><form id='dXBYb'><ins id='dXBYb'></ins><ul id='dXBYb'></ul><sub id='dXBYb'></sub></form><legend id='dXBYb'></legend><bdo id='dXBYb'><pre id='dXBYb'><center id='dXBYb'></center></pre></bdo></b><th id='dXBYb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dXBYb'><tfoot id='dXBYb'></tfoot><dl id='dXBYb'><fieldset id='dXBYb'></fieldset></dl></div>

                          主站蜘蛛池模板: 羞羞的视频在线观看 | 国产精品国产a级 | 操久久 | 亚洲电影一区 | 精品国产一区二区三区久久久蜜月 | 亚洲精品无 | 天天影视色综合 | 欧美电影一区 | 欧美操操操 | 美女视频. | 亚洲精品乱码久久久久久黑人 | 一级免费视频 | 国产色视频网站 | 中文字幕在线观看一区 | 成年人免费在线视频 | 亚洲欧洲av在线 | 国产精品一区二区在线 | 污视频免费在线观看 | 欧美成人hd | 中国大陆高清aⅴ毛片 | 欧美精品a∨在线观看不卡 欧美日韩中文字幕在线播放 | 日韩高清一区 | 欧美亚洲激情 | 伊人艹 | 国产精品精品视频 | 九九热这里 | 欧美三级三级三级爽爽爽 | 中文字幕精品一区久久久久 | 日本精品久久久久久久 | 九九精品在线 | 国产精品久久久久久久久久久久 | 国产精品毛片 | 亚av在线 | 粉嫩av在线| 久久久成人免费视频 | 婷婷综合五月天 | 亚洲精品免费在线观看 | 日本高清中文字幕 | 免费在线观看av的网站 | 久久精品91久久久久久再现 | 精品亚洲一区二区 |