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

    • <bdo id='9UUPG'></bdo><ul id='9UUPG'></ul>
  1. <small id='9UUPG'></small><noframes id='9UUPG'>

      <tfoot id='9UUPG'></tfoot>
    1. <i id='9UUPG'><tr id='9UUPG'><dt id='9UUPG'><q id='9UUPG'><span id='9UUPG'><b id='9UUPG'><form id='9UUPG'><ins id='9UUPG'></ins><ul id='9UUPG'></ul><sub id='9UUPG'></sub></form><legend id='9UUPG'></legend><bdo id='9UUPG'><pre id='9UUPG'><center id='9UUPG'></center></pre></bdo></b><th id='9UUPG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9UUPG'><tfoot id='9UUPG'></tfoot><dl id='9UUPG'><fieldset id='9UUPG'></fieldset></dl></div>
      <legend id='9UUPG'><style id='9UUPG'><dir id='9UUPG'><q id='9UUPG'></q></dir></style></legend>
    2. 帶有boxlayout的kivy滾動視圖

      kivy scrollview with boxlayout(帶有boxlayout的kivy滾動視圖)
      <legend id='U3SJi'><style id='U3SJi'><dir id='U3SJi'><q id='U3SJi'></q></dir></style></legend>

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

                <tbody id='U3SJi'></tbody>

              <tfoot id='U3SJi'></tfoot>
              • <bdo id='U3SJi'></bdo><ul id='U3SJi'></ul>
                <i id='U3SJi'><tr id='U3SJi'><dt id='U3SJi'><q id='U3SJi'><span id='U3SJi'><b id='U3SJi'><form id='U3SJi'><ins id='U3SJi'></ins><ul id='U3SJi'></ul><sub id='U3SJi'></sub></form><legend id='U3SJi'></legend><bdo id='U3SJi'><pre id='U3SJi'><center id='U3SJi'></center></pre></bdo></b><th id='U3SJi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='U3SJi'><tfoot id='U3SJi'></tfoot><dl id='U3SJi'><fieldset id='U3SJi'></fieldset></dl></div>

                本文介紹了帶有boxlayout的kivy滾動視圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我目前正在熟悉 kivy.我認為它有很大的潛力,但我確實發現普通 python"和 kv 語言之間的關系有點令人困惑,這使得很難理解在哪里做項目.目前在我看來,使用 python 與 kv-l 時的行為(幕后發生的事情)并不是一對一的,總的來說,我認為這使得可用性/生產力的標準相當高.

                I'm at the moment getting familiar with kivy. I think it has great potential, but I do find the relationship between "normal python" and the kv-language a bit confusing which makes it hard to understand where to do items. At the moment it appears to me that the behaviour (the things that happens behind the scenes) is not one to one when using python vs kv-l, in general I think that makes the bar quite high for usability/productivity.

                我和其他人一起使用了速成課程",這是獲得對 kivy 第一印象的良好開端.無論如何,在學習的過程中,我只是想看看我是否可以制作一個可滾動的 box-view - 結果我做不到.

                I've amongst others used the "crash course" by inclement which is a great start to get a first impression of kivy. Anyway, in the process of learning I just wanted to see if I could make a box-view scrollable - it turned out that I could not.

                需要什么才能使這段代碼正常工作,即將標簽擴展到它們的紋理大小",同時擁有一個可以調整的 ScrollView?

                What's needed to make this code work, i.e. expand the labels to their "texture-size", and at the same time having a ScrollView that adjusts to that?

                如果 BoxLayout 有 size_hint_y: None,則標簽不會擴展到文本,但是當窗口非常小時,可以看到滾動視圖.

                If the BoxLayout has a size_hint_y: None, the labels are not expanded to the text, but the scrollview can be seen in action when making the window really small.

                如果 BoxLayout 有 size_hint_y: 1,則標簽會展開,但顯然 boxlayout 的高度根本沒有改變,即滾動視圖窗口似乎與 size_hint_y: None 相同

                If the BoxLayout has a size_hint_y: 1, the labels are expanded, but apparantly the height of the boxlayout does not change at all, i.e. the scrollview window seems to be the same as with size_hint_y: None

                如果我只是輸入一個很大的高度,滾動視圖會覆蓋它,但我希望可以獲得與其內容耦合的 boxlayout 的動態高度.

                If I just put in a height which is large, the scrollview covers this, but I would expect that it's possible to get a dynamic height of the boxlayout coupled to it's content.

                我玩過高度、size_hints 等,但我沒有找到有效的組合,有時會收到警告說由于內部重繪循環需??要重新編寫代碼?

                I've played around with heights, size_hints, etc. and I have not found a combination that works and sometimes get warnings that the code needs to be remade due to internal redrawing loops?

                我錯過/不理解什么?

                代碼如下.

                from kivy.base import runTouchApp
                from kivy.lang import Builder
                from kivy.uix.scrollview import ScrollView
                
                Builder.load_string("""
                
                <ScrollableLabel>:
                    BoxLayout:
                        orientation: 'vertical'
                        # size_hint_y: 1
                        size_hint_y: None
                        height: 400 #self.size[1]
                        canvas:
                            Color:
                                rgba: (1, 0, 0, .5) # DarkOliveGreen
                            Rectangle:
                                size: self.size
                                pos: self.pos
                        Label:
                            id: bust
                            text: 'a string that is long ' * 10
                            font_size: 50
                            text_size: self.width, None
                            size_hint_y: None
                            height: self.texture_size[1]
                            canvas:
                                Color:
                                    rgba: (0, 1, 0, .5) # DarkOliveGreen
                                Rectangle:
                                    size: self.size
                                    pos: self.pos
                        Label:
                            text: '2 strings that are long ' * 10
                            text_size: self.width, None
                            size_hint_y: None
                            height: self.texture_size[1]
                        Button:
                            text: 'just testing'
                
                
                
                """)
                
                class ScrollableLabel(ScrollView):
                    pass
                
                runTouchApp(ScrollableLabel())
                

                推薦答案

                BoxLayout 的設計目的是讓它的子元素填充自己.您想要的動態調整大小的更好布局是 GridLayout,它有一個可以綁定到自動調整大小的 minimum_height.

                The BoxLayout is designed to make its children fill itself. A better layout for the dynamic resizing you want is the GridLayout, which has a minimum_height you can bind to for automatic resizing.

                <ScrollableLabel>:
                    GridLayout:
                        cols: 1
                        size_hint_y: None
                        height: self.minimum_height
                        canvas:
                            Color:
                                rgba: (1, 0, 0, .5) # DarkOliveGreen
                            Rectangle:
                                size: self.size
                                pos: self.pos
                        Label:
                            id: bust
                            text: 'a string that is long ' * 10
                            font_size: 50
                            text_size: self.width, None
                            size_hint_y: None
                            height: self.texture_size[1]
                            canvas:
                                Color:
                                    rgba: (0, 1, 0, .5) # DarkOliveGreen
                                Rectangle:
                                    size: self.size
                                    pos: self.pos
                        Label:
                            text: '2 strings that are long ' * 10
                            text_size: self.width, None
                            size_hint_y: None
                            height: self.texture_size[1]
                        Button:
                            text: 'just testing'
                """)
                

                這篇關于帶有boxlayout的kivy滾動視圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
              • <tfoot id='4waLk'></tfoot>
                  <legend id='4waLk'><style id='4waLk'><dir id='4waLk'><q id='4waLk'></q></dir></style></legend>
                    <tbody id='4waLk'></tbody>

                  <i id='4waLk'><tr id='4waLk'><dt id='4waLk'><q id='4waLk'><span id='4waLk'><b id='4waLk'><form id='4waLk'><ins id='4waLk'></ins><ul id='4waLk'></ul><sub id='4waLk'></sub></form><legend id='4waLk'></legend><bdo id='4waLk'><pre id='4waLk'><center id='4waLk'></center></pre></bdo></b><th id='4waLk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4waLk'><tfoot id='4waLk'></tfoot><dl id='4waLk'><fieldset id='4waLk'></fieldset></dl></div>
                    <bdo id='4waLk'></bdo><ul id='4waLk'></ul>

                      • <small id='4waLk'></small><noframes id='4waLk'>

                          主站蜘蛛池模板: 精品在线观看一区二区 | 午夜精品福利视频 | 成人在线播放网址 | 最新免费视频 | 久久久精品日本 | 国产农村妇女毛片精品久久麻豆 | 日韩欧美亚洲 | 一区视频在线播放 | 久久久久久久久久久成人 | 亚洲www | 午夜久久久 | 久久精品国产一区二区三区 | 午夜资源| 日一区二区 | 91美女在线 | 成在线人视频免费视频 | 欧美日韩在线综合 | 中文字幕在线第二页 | 亚洲网址 | 精品视频一区二区三区在线观看 | 国产性生活一级片 | 欧美精品在欧美一区二区少妇 | 91麻豆精品国产91久久久久久久久 | 九九久久精品视频 | 91精品久久久久久久久中文字幕 | 亚洲不卡 | 国产美女特级嫩嫩嫩bbb片 | 羞羞视频网站在线观看 | 91一区二区三区在线观看 | 欧美日韩精品一区二区三区视频 | 北条麻妃视频在线观看 | 日韩在线免费视频 | 久久成人综合 | 日本一区二区视频 | 中文字幕成人在线 | 国际精品鲁一鲁一区二区小说 | 国产欧美一区二区三区国产幕精品 | 日韩精品在线播放 | 欧洲精品一区 | 一区二区小视频 | 成人在线免费视频 |