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

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

        如何在 Kivy 的布局中获取小部件位置?

        时间:2023-10-09

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

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

        2. <i id='AvAyZ'><tr id='AvAyZ'><dt id='AvAyZ'><q id='AvAyZ'><span id='AvAyZ'><b id='AvAyZ'><form id='AvAyZ'><ins id='AvAyZ'></ins><ul id='AvAyZ'></ul><sub id='AvAyZ'></sub></form><legend id='AvAyZ'></legend><bdo id='AvAyZ'><pre id='AvAyZ'><center id='AvAyZ'></center></pre></bdo></b><th id='AvAyZ'></th></span></q></dt></tr></i><div id='AvAyZ'><tfoot id='AvAyZ'></tfoot><dl id='AvAyZ'><fieldset id='AvAyZ'></fieldset></dl></div>
          • <bdo id='AvAyZ'></bdo><ul id='AvAyZ'></ul>
                  本文介绍了如何在 Kivy 的布局中获取小部件位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个 GridLayout,我在添加图像后在其上添加了一些图像小部件.

                  I have a GridLayout and I added some Image widgets on it after adding of images I want to draw a rectangle in each image by using their canvas but I couldn't because I don't know the exact Image widgets positions on GridLayout.

                  在我的 Python 代码的最后一行:Rectangle(pos = (child.x - 2.4, child.y + 467), size = (70, 70))

                  In last line of my Python code : Rectangle(pos = (child.x - 2.4, child.y + 467), size = (70, 70))

                  如何在child中绘制这个矩形(我的方法不好^),

                  How to draw this rectangle in child(My method is not good^),

                  还有为什么我的 GridLayout 在设置为 pos_hint = {"center_x" : .5} 后没有居中?

                  Also Why my GridLayout not coming in center after setting it's pos_hint = {"center_x" : .5}?

                  推荐答案

                  如果我理解的问题是正确的,请尝试使用 to_local(), to_parent(), to_widget()to_window().您也可以尝试从小部件的位置中减去 GridLayout 的位置.

                  If I understand question right, try to use such methods as to_local(), to_parent(), to_widget() and to_window(). Also you could try to subtract position of your GridLayout from Widgets' positions.

                  这篇关于如何在 Kivy 的布局中获取小部件位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                    <tbody id='BV6SV'></tbody>

                2. <legend id='BV6SV'><style id='BV6SV'><dir id='BV6SV'><q id='BV6SV'></q></dir></style></legend>

                    • <small id='BV6SV'></small><noframes id='BV6SV'>

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