问题描述
我有一个小问题,我正在开发一个使用 python kivy gui 框架的小应用程序.我想要的只是隐藏主窗口的标题栏并使背景颜色透明.我在网上搜索了很多,但找不到解决方案.
I have a small problem and I am working on a small app that uses the python kivy gui framework. All i want is to hide the titlebar of the main window and make the background color transparent. I searched the net intensively but I couldn't find a solution for this.
有人知道怎么做吗?
谢谢
推荐答案
您可以使用 kivy.config.Config 禁用 bar.将fullscreen设置为fake:
You can disable bar using kivy.config.Config. Set fullscreen as fake:
from kivy.config import Config
Config.set('graphics', 'fullscreen', 'fake')
from kivy.app import App
from kivy.uix.button import Button
class MyApp(App):
def build(self):
button = Button(text="Exit", size_hint=(None, None))
button.bind(on_press=exit)
return button
if __name__ == '__main__':
MyApp().run()
您可以在此处找到更多配置选项:http://kivy.org/docs/api-kivy.config.html#available-configuration-tokens 例如,还要改变窗口的位置:
You can find more configuration options here: http://kivy.org/docs/api-kivy.config.html#available-configuration-tokens For example, to also change position of window:
from kivy.config import Config
Config.set('graphics', 'fullscreen', 'fake')
Config.set('graphics', 'position', 'custom')
Config.set('graphics', 'top', '300')
Config.set('graphics', 'left', '300')
from kivy.app import App
from kivy.uix.button import Button
class MyApp(App):
def build(self):
button = Button(text="Exit", size_hint=(None, None))
button.bind(on_press=exit)
return button
if __name__ == '__main__':
MyApp().run()
很遗憾,我不知道是否可以添加透明度.
Unfortunately, I don't know whether it's possible to add transparency.
这篇关于如何隐藏主窗口标题栏并在 kivy 框架中放置透明背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)