当前位置:网站首页>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:边栏推荐
猜你喜欢
随机推荐
Assets, vulnerabilities, threats and events of the four elements of safe operation
按键精灵打怪学习-自动回城路线的判断
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
(C语言)数据的存储
How wide does the dual inline for bread board need?
Linear programming of mathematical modeling (including Matlab code)
MongoDB系列之MongoDB常用命令
每日一题之干草堆的移动
12_ Implementation of rolling automatic video playback effect of wechat video number of wechat applet
Draw love with go+ to express love to her beloved
First hand evaluation of Reza electronics rz/g2l development board
On Fibonacci sequence
[Androd] Gradle 使用技巧之模块依赖替换
[introduction to AUTOSAR seven tool chain]
Understanding and distinguishing of some noun concepts in adjustment / filtering
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
MySQL --- 数据库查询 - 基本查询
ROS2之ESP32简单速度消息测试(极限频率)
2022.2.14 resumption
按键精灵打怪学习-前台和内网发送后台验证码









