当前位置:网站首页>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:边栏推荐
- 465. DFS backtracking of optimal bill balance
- Find a benchmark comrade in arms | a million level real-time data platform, which can be used for free for life
- 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 (cached_network_image network image caching plug-in)
- 删除有序链表中重复的元素-II
- 每日一题之干草堆的移动
- Asynchronous, email and scheduled tasks
- Merge K sorted linked lists
- Delete duplicate elements in the ordered linked list -ii
- Every k nodes in the linked list are flipped
猜你喜欢

Vulkan practice first bullet
![[overview of AUTOSAR three RTE]](/img/6a/0df33beb42f165af77a17b5d8b01e2.png)
[overview of AUTOSAR three RTE]

The difference between tail -f, tail -f and tail

excel IF公式判断两列是否相同
![[introduction to AUTOSAR seven tool chain]](/img/cf/ed0ccf39d38e0b4fc3d97d4fd58a7e.png)
[introduction to AUTOSAR seven tool chain]

leetcode-2280:表示一个折线图的最少线段数

Excel removes the data after the decimal point and rounds the number

(C语言)数据的存储

2022.2.14 resumption

瑞萨RZ/G2L ARM开发板存储读写速度与网络实测
随机推荐
Tensorflow 2. Chapter 15 of X (keras) source code explanation: migration learning and fine tuning
瑞萨电子RZ/G2L开发板上手评测
Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities
Leetcode-1964: find the longest effective obstacle race route to each position
leetcode-241:为运算表达式设计优先级
[introduction to AUTOSAR seven tool chain]
JS inheritance and prototype chain
安全运营四要素之资产、脆弱性、威胁和事件
删除有序链表中重复的元素-II
瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
深度剖析数据在内存中的存储
[shutter] image component (cached_network_image network image caching plug-in)
Usage of using clause in kingbases alter table
Leetcode-934: the shortest Bridge
Specified interval inversion in the linked list
Initial order of pointer (basic)
The R language uses the ctree function in the party package to build conditional inference decision trees, uses the plot function to visualize the trained conditional inference decision tree, and the
【无标题】
Excel if formula determines whether the two columns are the same
Lex & yacc & bison & flex configuration problems