当前位置:网站首页>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:
边栏推荐
- Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
- Leetcode-224: basic calculator
- 用Go+绘制爱心给心爱的她表白
- [AUTOSAR XIII NVM]
- Basic use of sringcloud & use of component Nacos
- Excel calculates the difference between time and date and converts it into minutes
- Initial order of pointer (basic)
- [AUTOSAR five methodology]
- [AUTOSAR twelve mode management]
- The difference between relational database and non relational database
猜你喜欢
leetcode:871. 最低加油次数【以前pat做过 + 最大堆 +贪心】
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
Draw love with go+ to express love to her beloved
用Go+绘制爱心给心爱的她表白
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
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
无向图的割点
寻找标杆战友 | 百万级实时数据平台,终身免费使用
【无标题】
JS inheritance and prototype chain
随机推荐
Leetcode-2280: represents the minimum number of line segments of a line graph
Linear programming of mathematical modeling (including Matlab code)
How to convert Quanzhi a40i/t3 to can through SPI
18_ The wechat video number of wechat applet scrolls and automatically plays the video effect to achieve 2.0
mysql 多表联合删除
异步、郵件、定時三大任務
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
信息熵的基础
FPGA - 7 Series FPGA internal structure clocking -04- multi area clock
MySQL multi table joint deletion
1038 Recover the Smallest Number
[case sharing] let the development of education in the new era advance with "number"
matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
The difference between relational database and non relational database
465. 最优账单平衡 DFS 回溯
寻找标杆战友 | 百万级实时数据平台,终身免费使用
Leetcode-1964: find the longest effective obstacle race route to each position
Win10 can't be installed in many ways Problems with NET3.5
R language generalized linear model function GLM, (model fit and expression diagnostics), model adequacy evaluation method, use plot function and car package function
数据分析思维分析犯法和业务知识——分析方法(一)