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

  2. <i id='xAIJR'><tr id='xAIJR'><dt id='xAIJR'><q id='xAIJR'><span id='xAIJR'><b id='xAIJR'><form id='xAIJR'><ins id='xAIJR'></ins><ul id='xAIJR'></ul><sub id='xAIJR'></sub></form><legend id='xAIJR'></legend><bdo id='xAIJR'><pre id='xAIJR'><center id='xAIJR'></center></pre></bdo></b><th id='xAIJR'></th></span></q></dt></tr></i><div id='xAIJR'><tfoot id='xAIJR'></tfoot><dl id='xAIJR'><fieldset id='xAIJR'></fieldset></dl></div>

    <legend id='xAIJR'><style id='xAIJR'><dir id='xAIJR'><q id='xAIJR'></q></dir></style></legend>
    • <bdo id='xAIJR'></bdo><ul id='xAIJR'></ul>

      <tfoot id='xAIJR'></tfoot>
    1. 具有圆角和阴影Kivy的图像

      Image with rounded corners and shadow Kivy(具有圆角和阴影Kivy的图像)
      <legend id='pHLVe'><style id='pHLVe'><dir id='pHLVe'><q id='pHLVe'></q></dir></style></legend>
        • <tfoot id='pHLVe'></tfoot>

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

              <bdo id='pHLVe'></bdo><ul id='pHLVe'></ul>
                <tbody id='pHLVe'></tbody>

              <i id='pHLVe'><tr id='pHLVe'><dt id='pHLVe'><q id='pHLVe'><span id='pHLVe'><b id='pHLVe'><form id='pHLVe'><ins id='pHLVe'></ins><ul id='pHLVe'></ul><sub id='pHLVe'></sub></form><legend id='pHLVe'></legend><bdo id='pHLVe'><pre id='pHLVe'><center id='pHLVe'></center></pre></bdo></b><th id='pHLVe'></th></span></q></dt></tr></i><div id='pHLVe'><tfoot id='pHLVe'></tfoot><dl id='pHLVe'><fieldset id='pHLVe'></fieldset></dl></div>
                本文介绍了具有圆角和阴影Kivy的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我怎么能对Kivy做这样的事情呢?

                推荐答案

                使用按钮的background_normal、background_down和border来实现此目的。让我们将您提供的两张图片命名为Norm.pngdown.png。请参考下面的示例了解详细信息。

                代码段

                Button:
                    background_normal: 'normal.png'
                    background_down: 'down.png'
                    border: 30,30,30,30
                

                示例

                main.py

                import kivy
                kivy.require('1.10.0')
                
                from kivy.app import App
                from kivy.uix.boxlayout import BoxLayout
                from kivy.lang import Builder
                
                Builder.load_string("""
                <RoundedButtons>:
                    orientation: 'vertical'
                    Button:
                        text: '[color=3333ff][b]Rounded Button 1[/b][/color]'
                        markup: True
                        background_normal: 'normal.png'
                        background_down: 'down.png'
                        border: 30,30,30,30
                    Button:
                        text: '[color=ff3333][b]Rounded Button 2[/b][/color]'
                        markup: True
                        background_normal: 'normal.png'
                        background_down: 'down.png'
                        border: 30,30,30,30
                """)
                
                
                class RoundedButtons(BoxLayout):
                    pass
                
                
                class TestApp(App):
                    def build(self):
                        return RoundedButtons()
                
                
                if __name__ == "__main__":
                    TestApp().run()
                

                输出

                这篇关于具有圆角和阴影Kivy的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                GUI Freezes while downloading PyQt5 and Pytube(GUI在下载PyQt5和Pytube时冻结)
                How to solve memory issues while multiprocessing using Pool.map()?(如何解决使用Pool.map()进行多处理时的内存问题?)
                Python - How to use FastAPI and uvicorn.run without blocking the thread?(Python-如何使用FastAPI和uvicorn.run而不阻塞线程?)
                How to increment a shared counter from multiple processes?(如何从多个进程递增共享计数器?)
                Using pika, how to connect to rabbitmq running in docker, started with docker-compose with external network?(使用pika,如何连接运行在docker中的rabbitmq,从docker开始-与外部网络连接?)
                How to use .rolling() on each row of a Pandas dataframe?(如何对 pandas 数据帧的每一行使用.roll()?)

              • <legend id='eTyOj'><style id='eTyOj'><dir id='eTyOj'><q id='eTyOj'></q></dir></style></legend>

                    <tbody id='eTyOj'></tbody>

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

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