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

  • <tfoot id='UzTrB'></tfoot>

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

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

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

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

      2. 在 Kivy 中更改按鈕的背景顏色

        Changing the background color of a Button in Kivy(在 Kivy 中更改按鈕的背景顏色)
        <i id='fk6qC'><tr id='fk6qC'><dt id='fk6qC'><q id='fk6qC'><span id='fk6qC'><b id='fk6qC'><form id='fk6qC'><ins id='fk6qC'></ins><ul id='fk6qC'></ul><sub id='fk6qC'></sub></form><legend id='fk6qC'></legend><bdo id='fk6qC'><pre id='fk6qC'><center id='fk6qC'></center></pre></bdo></b><th id='fk6qC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fk6qC'><tfoot id='fk6qC'></tfoot><dl id='fk6qC'><fieldset id='fk6qC'></fieldset></dl></div>
        <legend id='fk6qC'><style id='fk6qC'><dir id='fk6qC'><q id='fk6qC'></q></dir></style></legend>
          <tbody id='fk6qC'></tbody>
        1. <tfoot id='fk6qC'></tfoot>
              <bdo id='fk6qC'></bdo><ul id='fk6qC'></ul>

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

                • 本文介紹了在 Kivy 中更改按鈕的背景顏色的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我是 Kivy 的新手,無法指定按鈕的背景顏色.這是我的簡單示例:

                  I'm new to Kivy and having trouble specifying the background color of a Button. Here's my simple example:

                  # custombutton.py
                  
                  from kivy.app import App
                  from kivy.uix.widget import Widget
                  
                  
                  class MyWidget(Widget):
                      pass
                  
                  
                  class CustomButtonApp(App):
                      def build(self):
                          return MyWidget()
                  
                  
                  if __name__ == '__main__':
                      CustomButtonApp().run()
                  

                  以及隨附的kv文件custombutton.kv:

                  #:kivy 1.7.2
                  
                  <MyWidget>:
                      canvas:
                          Color:
                              rgb: (0.93, 0.93, 0.93)
                          Rectangle:
                              pos: self.pos
                              size: self.size
                  
                      Button:
                          center: self.parent.center
                          font_size: 14
                          height: 28
                          background_color: (1.0, 0.0, 0.0, 1.0)
                          text: "I'm a Button"
                  

                  我確定我遺漏了一些明顯的東西,但我已經搞砸了一個多小時,卻一無所獲.該按鈕似乎被染成了深紅色:

                  I'm sure I'm missing something obvious, but I've been messing with this for over an hour now and getting nowhere. The button seems to get colored a hint of very dark red:

                  這不是為 Kivy 中的按鈕指定背景顏色的方法嗎?

                  Is this not the way to specify the background color for a Button in Kivy?

                  謝謝!

                  推薦答案

                  啊,這是一個常見的混淆.問題是 Button.background_color 確實是一種 tint,而不僅僅是塊顏色.由于默認背景是灰色圖像(您通常會在制作無樣式按鈕時看到該圖像),因此您最終看到的是該灰色圖像的紅色調 - 您觀察到的暗紅色.

                  Ah, this is a common confusion. The problem is that Button.background_color really works as a kind of tint, not just a block colour. Since the default background is a grey image (the one you normally see if you make an unstyled button), what you end up seeing is a red tint to that grey image - which comes out as the dark red you observe.

                  您可以通過將背景圖像替換為純白色(不必超過幾個像素)或使用 background_normal 來獲得所需的行為和 background_down 屬性.當您的 background_color 為新的純白色圖像著色時,您將獲得所需的純紅色.

                  You can get the behaviour you want by replacing the background image to just one that's plain white (it doesn't have to be more than a few pixels), or by otherwise playing with the background_normal and background_down properties. When your background_color tints the new pure white image, you get the pure red you're after.

                  我想這在文檔中不是很清楚,我會嘗試改進它.

                  I guess this isn't so clear in the docs, I'll try to improve it.

                  這篇關于在 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 - 自動更改角色顏色)
                  1. <legend id='T2rxw'><style id='T2rxw'><dir id='T2rxw'><q id='T2rxw'></q></dir></style></legend>

                    • <bdo id='T2rxw'></bdo><ul id='T2rxw'></ul>

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

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

                          1. 主站蜘蛛池模板: 国产成人精品久久二区二区91 | 精产国产伦理一二三区 | 97在线观看 | 黄色毛片一级 | 久草网站 | 成人免费淫片aa视频免费 | 99精品视频一区二区三区 | 国内av在线 | 另类二区 | 五月婷婷视频 | 久久国内精品 | 色妹子综合网 | 91 久久 | 福利一区二区在线 | 亚洲一区电影 | 日韩精品免费在线观看 | 国产精品亚洲综合 | 日韩福利 | 亚洲 欧美 日韩在线 | 一区二区三区高清 | 91大神在线看| 日韩一区二区三区视频在线观看 | 在线男人天堂 | 日本不卡一区二区三区在线观看 | 亚洲精品电影在线观看 | 中文字幕欧美日韩一区 | 爱爱无遮挡 | 日本精品一区二区三区在线观看视频 | 激情五月综合网 | 国产精品久久久久久久白浊 | 亚洲区中文字幕 | 欧美精品久久 | 久久精品亚洲精品国产欧美 | 成人av网站在线观看 | 国产男女精品 | 欧美成人猛片aaaaaaa | 中文字幕在线观看视频网站 | 精品久久久久久 | 不卡视频一区二区三区 | 欧美日韩黄色一级片 | 午夜小视频免费观看 |