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

        <tfoot id='FPOk3'></tfoot>
          <bdo id='FPOk3'></bdo><ul id='FPOk3'></ul>
        <legend id='FPOk3'><style id='FPOk3'><dir id='FPOk3'><q id='FPOk3'></q></dir></style></legend>

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

      1. 在 Python kivy 应用程序中使用操作栏面临的问题

        时间:2023-06-07
          <bdo id='wJU32'></bdo><ul id='wJU32'></ul>

            <tfoot id='wJU32'></tfoot>
          • <small id='wJU32'></small><noframes id='wJU32'>

            1. <legend id='wJU32'><style id='wJU32'><dir id='wJU32'><q id='wJU32'></q></dir></style></legend>
                <tbody id='wJU32'></tbody>
                  <i id='wJU32'><tr id='wJU32'><dt id='wJU32'><q id='wJU32'><span id='wJU32'><b id='wJU32'><form id='wJU32'><ins id='wJU32'></ins><ul id='wJU32'></ul><sub id='wJU32'></sub></form><legend id='wJU32'></legend><bdo id='wJU32'><pre id='wJU32'><center id='wJU32'></center></pre></bdo></b><th id='wJU32'></th></span></q></dt></tr></i><div id='wJU32'><tfoot id='wJU32'></tfoot><dl id='wJU32'><fieldset id='wJU32'></fieldset></dl></div>
                  本文介绍了在 Python kivy 应用程序中使用操作栏面临的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 Kivy 开发应用程序.我正在使用 Kivy ActionBar 为我的应用程序创建一个菜单栏.

                  I am working on developing an application using Kivy. I am using Kivy ActionBar for creating a menu bar for my application.

                  请参考附图

                  我想删除 Kivy 图标并将其他选项(文件/编辑)移动到左侧.请找到我的代码片段.

                  I want to remove the Kivy icon and move the other options(file / edit) to the left. Please find the snippet of my code.

                  menuAcBar  = ActionBar(pos_hint={'top': 1.3})
                  menuAcView = ActionView()
                  menuAcBar.add_widget(menuAcView)
                  menuAcPrevious = ActionPrevious(with_previous=False)
                  
                  menuAcView.add_widget(menuAcPrevious)
                  menuAcView.add_widget(ActionButton(text="File"))
                  menuAcView.add_widget(ActionButton(text="Edit"))
                  menuAcView.add_widget(ActionButton(text="Documents"))
                  menuAcView.add_widget(ActionButton(text="help"))
                  
                  self.add_widget(menuAcBar)
                  

                  推荐答案

                  ActionPrevious上可以设置app_icon.docs 中略低一些.您可以为图标的大小设置 app_icon_width/height,甚至可以使用 app_icon='' 将其删除,但它会留下白色矩形而不是透明".保留 app_icon 并仅设置宽度和高度使其不可见.

                  Right on ActionPrevious you can set app_icon. It's a little bit lower in docs. You can set app_icon_width/height for size of the icon or even remove it with app_icon='', but it'll leave white rectangle instead of a "transparent". Leave app_icon be and set only width and height to make it invisible.

                  ctionPrevious 具有 ActionItem 的 minimum_width 属性,因此您需要像这样更改它:

                  The ctionPrevious has ActionItem's minimum_width property, therefore you need to change it like this:

                  menuAcPrevious = ActionPrevious(with_previous=False,
                                           app_icon=<your_image>,
                                           app_icon_width=1,
                                           app_icon_height=0,
                                           minimum_width=10,
                                           size_hint_x: None)
                  

                  似乎 ActionPrevious 留下了额外的未使用空间,即使 title=''minimum_width=1 并且您无法通过孩子访问该死的东西因为它是 未注册,所以我唯一的想出的是调整它的大小,这样你就不会再看到它了:

                  It seems that ActionPrevious leaves additional unused space even if title='' and minimum_width=1 and you can't access the damn thing through children because it's unregistered, therefore the only thing I came up with is resizing it so you won't see it anymore:

                  ActionPrevious(
                      size_hint_x = None,
                      width = 0,
                      app_icon_width = 0.1,
                      with_previous = False)
                  

                  这篇关于在 Python kivy 应用程序中使用操作栏面临的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Kivy 日期选择器小部件 下一篇:是否可以在 Kivy 应用程序中读取多个 .kv 文件?

                  相关文章

                  1. <tfoot id='i0Mfy'></tfoot>
                      <bdo id='i0Mfy'></bdo><ul id='i0Mfy'></ul>
                    <legend id='i0Mfy'><style id='i0Mfy'><dir id='i0Mfy'><q id='i0Mfy'></q></dir></style></legend>

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

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