我们在 kivy 应用程序中使用图像作为弹出窗口,但似乎无法让弹出窗口的背景适合图像的大小.生成的弹出窗口中的图像在图像的左侧、顶部和右侧周围带有深灰色边框.有人可以帮我们消除弹出窗口的背景,以便只看到图像和半透明滤镜吗?
we're using an image as a popup in our kivy app but can't seem to get the popup's background to fit the size of the image. The resulting popup has the image with a dark gray border around the left side, top, and right side of the image. Can someone help us eliminate the popup's background so that only the image and the semi-transparent filter are visible?
Main.py 代码:
Main.py code:
popup = Popup(title="",
content=Image(source='img/popup'),
auto_dismiss=True,
size_hint=(None, None),
size=(400, 146),
separator_height=0
)
谢谢
如果你没有标题,也许一个简单的 ModalView 会更适合你的目的.
If you don't have a title, maybe a simple ModalView would better fit your purposes.
无论哪种方式,背景都由 background 和 background_color 属性控制.要完全摆脱它,设置 popup.background_color=(0, 0, 0, 0) (即透明)可能是最简单的.
Either way, the background is controlled by the background and background_color properties. To get rid of it entirely, it's probably simplest to set popup.background_color=(0, 0, 0, 0) (i.e. transparent).
这篇关于格式化 Kivy 弹出窗口以消除弹出背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何制作一个在 Python 中提供角色的不和谐机器人How to make a discord bot that gives roles in Python?(如何制作一个在 Python 中提供角色的不和谐机器人?)
Discord 机器人没有响应命令Discord bot isn#39;t responding to commands(Discord 机器人没有响应命令)
你能得到“关于我"吗?Discord 机器人的功能?Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“关于我吗?Discord 机器人的功能?(不和谐.py))
message.channel.id Discord PYmessage.channel.id Discord PY(message.channel.id Discord PY)
如何在 heroku 上托管我的 discord.py 机器人?How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 机器人?)
discord.py - 自动更改角色颜色discord.py - Automaticaly Change an Role Color(discord.py - 自动更改角色颜色)