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

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

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

          <bdo id='NOs5J'></bdo><ul id='NOs5J'></ul>

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

        在 Kivy 中將圖像對象作為按鈕背景傳遞

        Passing image object as a button background in Kivy(在 Kivy 中將圖像對象作為按鈕背景傳遞)

            <tfoot id='xtcyv'></tfoot>
              <bdo id='xtcyv'></bdo><ul id='xtcyv'></ul>

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

                  <i id='xtcyv'><tr id='xtcyv'><dt id='xtcyv'><q id='xtcyv'><span id='xtcyv'><b id='xtcyv'><form id='xtcyv'><ins id='xtcyv'></ins><ul id='xtcyv'></ul><sub id='xtcyv'></sub></form><legend id='xtcyv'></legend><bdo id='xtcyv'><pre id='xtcyv'><center id='xtcyv'></center></pre></bdo></b><th id='xtcyv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xtcyv'><tfoot id='xtcyv'></tfoot><dl id='xtcyv'><fieldset id='xtcyv'></fieldset></dl></div>
                    <tbody id='xtcyv'></tbody>
                1. <legend id='xtcyv'><style id='xtcyv'><dir id='xtcyv'><q id='xtcyv'></q></dir></style></legend>
                2. 本文介紹了在 Kivy 中將圖像對象作為按鈕背景傳遞的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在 Kivy 中,有沒有辦法將圖像對象作為按鈕背景傳遞,而不是圖像文件名?

                  In Kivy, is there a way to pass image object as a button background, instead of image file name?

                  button.background_normal 屬性只接受字符串.我想自定義圖像屬性,例如 allow_stretch = False.

                  button.background_normal property accepts only strings. I would like to customize image properties, such as allow_stretch = False.

                  如果成功,我如何在按鈕內(nèi)指定圖像對齊方式,例如.讓它左上對齊?

                  If that succeeds, how can I specify image alignment inside a button, eg. to make it top-left aligned?

                  推薦答案

                  source 只是 Button 的一個屬性,正如你所指出的,它是一個字符串.你想要一個 Widget 里面有一個 Widget,這就是 Kivy 工作的基本方式.所以只需按原樣添加圖像.一點定位就可以完成剩下的工作.

                  The source is just a property of Button and it is a string as you pointed out. You want a Widget inside a Widget, and that is the basic way Kivy works. So just add the Image as it is. A little bit of positioning would do the rest.

                  你必須小心定位.確保它位于可見部分并且沒有任何東西覆蓋它.我在按鈕后使用標簽,因為它具有透明顏色,因此您可以嘗試使用它.例如,如果您的定位錯誤(嘗試 x:0 y:0),您可以看到按鈕轉(zhuǎn)到標簽區(qū)域的左下角.

                  You have to be careful with the positioning. Make sure it is in a visible part and nothing covers it. I use a Label after the button because it has transparent Color so you can experimenting with it. For example if your positioning is wrong (try x:0 y:0) you can see the button going to the bottom-left corner in the label area.

                  我使用的圖片是 Kivy 標志:

                  from kivy.app import App
                  from kivy.uix.boxlayout import BoxLayout
                  from kivy.lang import Builder
                  
                  Builder.load_string("""
                  <ButtonsApp>:
                      orientation: "vertical"
                      Button:
                          text: "B1"
                          Image:
                              source: 'kivy.png'
                              y: self.parent.y + self.parent.height - 250
                              x: self.parent.x
                              size: 250, 250
                              allow_stretch: True
                      Label:
                          text: "A label"
                  """)
                  
                  class ButtonsApp(App, BoxLayout):
                      def build(self):
                          return self
                  
                  if __name__ == "__main__":
                      ButtonsApp().run()
                  

                  這篇關(guān)于在 Kivy 中將圖像對象作為按鈕背景傳遞的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  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)(你能得到“關(guān)于我嗎?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 - 自動更改角色顏色)

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

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

                    <tbody id='YSGpr'></tbody>
                      • <bdo id='YSGpr'></bdo><ul id='YSGpr'></ul>

                        <legend id='YSGpr'><style id='YSGpr'><dir id='YSGpr'><q id='YSGpr'></q></dir></style></legend>
                          1. <tfoot id='YSGpr'></tfoot>

                            主站蜘蛛池模板: 国产一区二区三区免费视频 | 成人国产综合 | 在线观看你懂的网站 | 久久久久久久电影 | 国产精品国产精品国产专区不卡 | 国产精品一区二区免费 | 亚洲精品一区二区三区免 | 天天综合天天 | 草久久 | 久久久九九| 成年人在线| 一区二区三区日韩精品 | 国产美女免费视频 | 欧美日韩精品免费观看 | 久久久久久一区 | 日韩欧美一区二区三区免费看 | 久久成人精品视频 | 国产成人在线一区二区 | 亚洲视频一区在线 | 亚洲成人在线网 | 午夜影院视频在线观看 | 国产精品久久国产精品久久 | 午夜国产 | 亚洲精品视频一区 | 亚洲黄色成人网 | 亚洲乱码一区二区三区在线观看 | 国产在线看片 | 一级毛片高清 | av毛片免费| 99久久精品免费看国产四区 | 国产精品成人久久久久 | 久久精品在线播放 | 日韩精品免费 | 羞羞视频在线观看 | 免费黄色片视频 | 俺去俺来也www色官网cms | 精品久久久久久久久久久久 | 毛片一级网站 | 国产精品久久久久久久久动漫 | 亚洲欧美精品 | 免费看91 |