当前位置:网站首页>Kivy tutorial how to create drop-down lists in Kivy
Kivy tutorial how to create drop-down lists in Kivy
2022-07-03 01:18:00 【Knowledge fatness】
Below I provide a usage ScreenManager stay Kivy An example of creating a drop-down list in . Please note that , This applies to all layouts , But I found that GridLayout Is the easiest to control . You can copy and paste it into your code .

from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
Builder.load_file("try_out_app.kv")
class ExampleScreen(Screen):
pass
class RootWidget(ScreenManager):
pass
class Demo(App):
def build(self):
return RootWidget()
if __name__ == "__main__":
Demo().run()
Interface
<ExampleScreen>:
name: "example_screen"
GridLayout:
cols: 1
padding: 100, 20
size_hint: 0.5, 0.5
Button:
id: btn
text: "select"
size_hint: None, None
on_parent: drop_content.dismiss()
on_release: drop_content.open(self)
DropDown:边栏推荐
- 链表内指定区间反转
- 拥抱平台化交付的安全理念
- MySQL foundation 04 MySQL architecture
- 1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
- 按键精灵打怪学习-前台和内网发送后台验证码
- 鏈錶內指定區間反轉
- 正确甄别API、REST API、RESTful API和Web Service之间的异同
- 【FPGA教程案例5】基于vivado核的ROM设计与实现
- [AUTOSAR XIII NVM]
- The latest analysis of tool fitter (technician) in 2022 and the test questions and analysis of tool fitter (technician)
猜你喜欢
随机推荐
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
Asynchronous, email and scheduled tasks
tp6快速安装使用MongoDB实现增删改查
Basic remote connection tool xshell
How wide does the dual inline for bread board need?
Foundations of data science is free to download
Understanding and distinguishing of some noun concepts in adjustment / filtering
Delete duplicate elements in the ordered linked list -ii
[shutter] image component (cached_network_image network image caching plug-in)
异步、邮件、定时三大任务
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
MySQL foundation 07-dcl
Matlab finds the position of a row or column in the matrix
Androd Gradle 对其使用模块依赖的替换
信息熵的基础
[AUTOSAR 11 communication related mechanism]
Strongly connected components of digraph
[自我管理]时间、精力与习惯管理
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
Telephone network problems


![[untitled]](/img/fd/f6b90536f10325a6fdeb68dc49c72d.png)





