当前位置:网站首页>Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
2022-07-03 12:40:00 【知识大胖】
什么是BoxLayout

BoxLayout将子项排列在垂直或水平框中。
- 要将小部件放置在彼此上方/下方,请使用垂直BoxLayout
- 要将小部件彼此相邻放置,请使用水平BoxLayout。在这个例子中,我们使用 10 个像素间距的孩子;第一个按钮覆盖 70% 的水平空间,第二个按钮覆盖 30%
实战代码

from kivy.app import App
from kivy.lang import Builder
# File: clock.kv
KV = '''
BoxLayout:
orientation: 'vertical'
Label:
text: '00:00:00'
'''
class ClockApp(App):
def build(self):
return Builder.load_string(KV)
if __name__ == '__main__':
ClockApp().run()
边栏推荐
- 【数据库原理及应用教程(第4版|微课版)陈志泊】【第五章习题】
- C graphical tutorial (Fourth Edition)_ Chapter 15 interface: interfacesamplep268
- 2022-02-11 heap sorting and recursion
- The principle of human voice transformer
- Today's sleep quality record 77 points
- R语言使用data函数获取当前R环境可用的示例数据集:获取datasets包中的所有示例数据集、获取所有包的数据集、获取特定包的数据集
- 双链笔记 RemNote 综合评测:快速输入、PDF 阅读、间隔重复/记忆
- MapReduce实现矩阵乘法–实现代码
- 剑指 Offer 15. 二进制中1的个数
- Understanding of CPU buffer line
猜你喜欢

2022-02-11 heap sorting and recursion
![[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]](/img/8b/bef94d11ac22e3762a570dab3a96fa.jpg)
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]

elk笔记24--用gohangout替代logstash消费日志

Resolved (error in viewing data information in machine learning) attributeerror: target_ names

Flink SQL knows why (XV): changed the source code and realized a batch lookup join (with source code attached)

Sword finger offer 12 Path in matrix

【Colab】【使用外部数据的7种方法】

106. How to improve the readability of SAP ui5 application routing URL

When we are doing flow batch integration, what are we doing?

Image component in ETS development mode of openharmony application development
随机推荐
道路建设问题
2022-02-14 analysis of the startup and request processing process of the incluxdb cluster Coordinator
The 35 required questions in MySQL interview are illustrated, which is too easy to understand
MapReduce实现矩阵乘法–实现代码
Elk note 24 -- replace logstash consumption log with gohangout
stm32和电机开发(从mcu到架构设计)
Flink code is written like this. It's strange that the window can be triggered (bad programming habits)
Annotation and reflection
Kotlin - improved decorator mode
Oracle memory management
PowerPoint tutorial, how to save a presentation as a video in PowerPoint?
Today's sleep quality record 77 points
[data mining review questions]
Flink SQL knows why (XIV): the way to optimize the performance of dimension table join (Part 1) with source code
我的创作纪念日:五周年
In the promotion season, how to reduce the preparation time of defense materials by 50% and adjust the mentality (personal experience summary)
2022-02-13 plan for next week
【R】 [density clustering, hierarchical clustering, expectation maximization clustering]
Logback 日志框架
File uploading and email sending