当前位置:网站首页>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:边栏推荐
- Understanding and distinguishing of some noun concepts in adjustment / filtering
- leetcode-224:基本计算器
- [AUTOSAR II appl overview]
- 这不平凡的两年,感谢我们一直在一起!
- Leetcode-241: designing priorities for operational expressions
- 12_微信小程序之微信视频号滚动自动播放视频效果实现
- 有向图的强连通分量
- [overview of AUTOSAR four BSW]
- Assets, vulnerabilities, threats and events of the four elements of safe operation
- Illustrated network: what is virtual router redundancy protocol VRRP?
猜你喜欢
![[applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions](/img/ea/ee1ad50a497478b9d080bb5e4bdfb5.png)
[applet project development -- JD mall] user defined search component of uni app (middle) -- search suggestions

Excel if formula determines whether the two columns are the same

matlab 多普勒效应产生振动信号和处理

测试右移:线上质量监控 ELK 实战

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

异步、郵件、定時三大任務

Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities

Excel calculates the difference between time and date and converts it into minutes

飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022

Arduino开发之按键检测与正弦信号输出
随机推荐
Tensorflow 2. Chapter 15 of X (keras) source code explanation: migration learning and fine tuning
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
Machine learning: numpy version linear regression predicts Boston house prices
Strongly connected components of digraph
每日一题之干草堆的移动
[overview of AUTOSAR three RTE]
leetcode:701. 二叉搜索树中的插入操作【bst的插入】
Leetcode-1964: find the longest effective obstacle race route to each position
瑞萨RZ/G2L ARM开发板存储读写速度与网络实测
MySQL
信息熵的基础
excel IF公式判断两列是否相同
leetcode-2280:表示一个折线图的最少线段数
[AUTOSAR XIII NVM]
ROS2之ESP32简单速度消息测试(极限频率)
【C语言】分支和循环语句(上)
[AUTOSAR eight OS]
R language ggplot2 visual faceting, visual facet_wrap bar plot, using strip Text function customize the size of the strip of each facet title in the facet graph (cutimi
Understanding and distinguishing of some noun concepts in adjustment / filtering
Draw love with go+ to express love to her beloved