当前位置:网站首页>Kivy教程大全之如何在 Kivy 中创建下拉列表
Kivy教程大全之如何在 Kivy 中创建下拉列表
2022-07-03 00:46:00 【知识大胖】
下面我提供了一个使用 ScreenManager 在 Kivy 中创建下拉列表的示例。请注意,这适用于所有布局,但我发现 GridLayout 是最容易控制的。您可以将其复制并粘贴到您的代码中。
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()
界面
<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:
边栏推荐
- Vulkan practice first bullet
- 瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
- Excel calculates the difference between time and date and converts it into minutes
- R language uses coin package to apply permutation tests to independence problems (permutation tests, whether response variables are independent of groups, are two numerical variables independent, and
- 递归处理组织的几种情况
- [shutter] image component (configure local GIF image resources | load placeholder with local resources)
- Matlab saves the digital matrix as geospatial data, and the display subscript index must be of positive integer type or logical type. Solve the problem
- 正确甄别API、REST API、RESTful API和Web Service之间的异同
- Excel removes the data after the decimal point and rounds the number
- Test shift right: Elk practice of online quality monitoring
猜你喜欢
瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
2022.2.14 resumption
瑞萨RZ/G2L ARM开发板存储读写速度与网络实测
Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
Initial order of pointer (basic)
[AUTOSAR 11 communication related mechanism]
FPGA - 7 Series FPGA internal structure clocking -04- multi area clock
异步、郵件、定時三大任務
[AUTOSAR five methodology]
研发一款国产ARM智能边缘计算网关需要什么
随机推荐
递归处理组织的几种情况
12_微信小程序之微信视频号滚动自动播放视频效果实现
[applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions
[C language] branch and loop statements (Part 1)
Strongly connected components of digraph
Correctly distinguish the similarities and differences among API, rest API, restful API and web service
leetcode-2115:从给定原材料中找到所有可以做出的菜
tail -f 、tail -F、tailf的区别
What is needed to develop a domestic arm intelligent edge computing gateway
leetcode-241:为运算表达式设计优先级
ROS2之ESP32简单速度消息测试(极限频率)
KingbaseES ALTER TABLE 中 USING 子句的用法
[AUTOSAR + IO Architecture]
[AUTOSAR I overview]
1038 Recover the Smallest Number
RK3568开发板评测篇(二):开发环境搭建
leetcode-849:到最近的人的最大距离
Vulkan practice first bullet
leetcode-1964:找出到每个位置为止最长的有效障碍赛跑路线
安全运营四要素之资产、脆弱性、威胁和事件